NancyFx/Nancy — pull request #831 by adamralph (2012-11-20 19:21:13+00:00)
Title: Xbehave sample

I noticed in a lot of your tests you are keen on the BDD-style Given-When-Then language.

I just thought I'd throw this pull request out there to see if you guys would be interested in using xBehave.net for these tests. (Full Disclosure: I am the author of xBehave.net!) https://github.com/xbehave/xbehave.net

xBehave.net supports Given-When-Then as first class test API members. You can see this from the replacement code I've written for DefaultResponseFormatterFixture.

Note that each step generates its own test command and therefore appears as a distinct item in the test ouput. Where you had just two items in your test output before, you will now see 7 items, one for each Given, When and Then. The advantage of this is that when you have a failure, you don't just see "your test method failed". Instead you see "Then the root path should equal 'foo' failed".

The first commit is just an update to the latest xUnit.net packages. Note that I had to fix the xUnit.net package installation in Nancy.Validation.FluentValidation.Tests since it was broken (missing from packages.config).

The second commit is the interesting one with the actual conversion of a test from xUnit.net to xBehave.net.

If you feel that xBehave.net is not something you are interested in, I won't be offended ;-). I just thought that you might be interested since I spotted the Given-When-Then language usage in your tests.