Trying to compare the differences between MSpec, xUnit and NSpec. The following examples try to be an apples to apples comparision between the frameworks.
Each gist contains a url to the original gist these samples were pulled from. You may find valuable comments there.
I tried to keep spacing and general flow consistent between the gists.
A little bit of elaboration on the gists:
- the first gist (denoted by
1_) is an MSpec test suite
- the second gist (denoted by
2_) shows how that exact MSpec test would look in NSpec
- the third gist (denoted by
3_) shows how to write the the test using xUnit, NUnit, MSTest or Fixie
- keep in mind that version
3_(depending on the framework) will contain additional attributes
- the NUnit flavored framework gist deviated enough from the original to constitute a followup gist
- the reason behind the deviation is explained here: Test styles and avoiding setup/teardown, take the time to read it
- the fourth gist (denoted by
4_) shows how you would write the altered (new) [x][MS][N]Unit version of the test, but written in NSpec using classes
- the fifth gist (denoted by
5_) show another appraoch to writing the altered (new) [x][MS][N]Unit version of the test, but written in NSpec using lambdas