I’m currently programming in C# and I am using Visual Studio 2010, .Net 4, SpecFlow, NUnit and I’m curious if there is a way for SpecFlow to automatically generate me a *StepDefintion.cs for my *.feature file. Currently I have to copy and paste the generated code into a new “SpecFlow Step Definition” File.
If anyone knows if this is possible, and how to do it that would be great!
Not out of the box. There is a tutorial on using nUnit and geting the code to rough in the steps, but I did not use SpecFlow for our project long enough to determine where it generates this stub code. A bit of searching should find the answer. Worst case, find the tutorial for SpecFlow and nUnit with the code generated in nUnit (pretty neat stuff, although not automated).
I have some code somewhere that I started to write to create the stub file, but the decision not to use SpecFlow moved me away from this direction (could not justify the time any more). I thought I blogged it but a search of my blog yielded nada (ASIDE: you can find SpecFlow at site:gregorybeamer.wordpress.com, but it is a general “unit testing” post).
I had thought about contribing the code, but the number of different possibilities made my head swim considering the lack of free time I have now to contrib to open source. 😉