• Why don't my nested tests run in sequential order?
      These questions, surprisingly, are related. Here's an eloquent explanationfrom one of that sheds light on these questions:
    I Initially thought would execute as , in other words, sequentially.As you all know, this is actually executed first as A1B2 and then .Once I realized this, I actually realized the power of goconvey, becauseit allows you two write n tests with log(n) statements. This "tree-based"behavioral testing eliminates so much duplicated setup code and is so mucheasier to read for completeness (versus pages of unit tests) while stillallowing for very well isolated tests (for each branch in the tree).

    In the psuedo code above, Convey A serves as a "Setup" method for and Convey C and is run separately for each. Here's a more complex example:

    is the correct answer.

    Gotchas

    If you're wondering about how to achieve "tear-down" functionality, see the page on the Reset function.