Cucumber alternative for .NET

Solution 1:

You should also check out SpecFlow, that is an open-source project to do BDD with .NET.

SpecFlow is using the same definition format (Gherkin), like cucumber, but you can write your step definitions in .NET. It basically generates unit-test classes (NUnit, MsTest, xUnit, etc.) from your feature files, so you can use the same unit test execution engine, like you do with the real unit tests. This way it is also easier to integrate the BDD functional tests to the integration build.

In the recent versions SpecFlow has a syntax coloring feature for Visual Studio 2010 and support for Silverlight and Mono/MonoDevelop.

Solution 2:

Sure. It's called Cucumber. There's an example for how to test .NET code in the Cucumber examples directory and documentation on the Cucumber Wiki for both .NET and Mono.

Solution 3:

There seem to be 3 possibilities in this space:

  1. Use Cucumber and IronRuby. Here's a blog on some steps to get started with this. The downside seems to be performance. I've read accounts that say its slower in general, and others that say it's just really slow to spin up. This is far from conclusive though, since IronRuby is still in active development.

  2. Use Cuke4Nuke. I've heard this product recommended a few times. It actually uses regular Ruby and Cucumber but runs your .NET code through a server. Fortunately, all that complication is transparent as you are using it. Cuke4Nuke is no longer under active development.

  3. Use SpecFlow. This is a .NET port of Cucumber. Because of this, it may not have all of Cucumber's features, and it may have extra features. The nice thing is you don't have to have Ruby installed.

At this time it doesn't seem clear which of these is the best option. Personally I'm planning on starting with Cuke4Nuke.

Solution 4:

StoryTeller is somewhat related even though it is not strictly BDD. It seems to support a somewhat different kind of test but is written in .NET. Read more on Jeremy Millers blog