Search code examples
.netcucumber

Cucumber alternative for .NET


Quick one, has anyone come across a library similar to Ruby's cucumber (a human readable DSL for defining use case stories that can be tested against) in the .NET sphere?


Solution

  • 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.

    Update 3/8/2024: After 14 years of history we had to reboot (fork & rename) the SpecFlow project with a new name: Reqnroll. Reqnroll works closely together with the Cucumber team and will now become the official .NET implementation of Cucumber. You can find more info on the reboot in the announcement post.