trackabout/speceasy — pull request #19 by rockhymas (2013-10-11 15:25:04+00:00)
Title: Break out each assertion into its own test

By using a test case source, and building up an Action object to run for
each test case, each test case can display as a separate test in NUnit.
Reporting can be done more easily, as the NUnit reporting is now fairly
complete, although individual tests don't display very well in the tree
view. It also makes it possible to filter out the tests on the Spec
class itself, thus making full test runs against the SpecEasy solution
possible. If we were to remove the ability to check exceptions in a
delegate, and just have an expected exception type, we could also use the
NUnit expected exception handling.

Note that this does have some interesting side effects. First of all,
because tests are completely built up in advance, test order is less tied
to order in the code, and so should not be relied on. Additionally, test
code that is not in a Given/When/Then will get run during test
construction, but not during test execution. So member variables that are
reset in test code outside of a given/when/then no longer work. The tests
that relied on this behavior have been fixed in this change, but other code
may rely on it as well, and would need to be changed accordingly. Overall,
this is a good change, as it more clearly delineates code executed during
tests and code executed to create the test cases.

Pic of the SpecEasy test output in VS/Resharper before the changes:
![image](https://f.cloud.github.com/assets/142136/1315600/00147d28-3289-11e3-913f-e3919c4c7dc3.png)

Pic of the SpecEasy test output in VS/Resharper with the changes (note the lack of test failures):
![image](https://f.cloud.github.com/assets/142136/1315580/a35923f4-3288-11e3-907c-6e317c4d3cb5.png)