开发者

SpecFlow custom tool "SpecFlowSingleFileGenerator"

I found that this custom开发者_如何转开发 tool is used for generation of .cs files from SpecFlow's .feature file. Is there a way to use this tool outside of VS? I would like to call this tool from console for specific .feature file when building my project with NAnt.

Regards,

Vajda Vladimir


You sure can! That is if you mean: "Can I generate unit test code from my .feature-files without using Visual Studio"

I've written about that here: http://www.marcusoft.net/2010/12/specflowexe-and-mstest.html but in short you can use the SpecFlow.exe with the "generateAll" switch, and it will inspect your project settings and generate the appropiate unit tests for you (in my example it's MsTest but it can be any of the supported testing frameworks).

The SpecFlow.exe's help we get the following concise help:

Generate tests from all feature files in a project
usage: specflow generateall projectFile [/force] [/verbose]
    projectFile  Visual Studio Project File containing features

So for a project called Specs.csproj it would be:

"%ProgramFiles(x86)%\TechTalk\SpecFlow\SpecFlow.exe" generateAll Specs\Specs.csproj /force /verbose

You can read more in my blog post - but this is basically it.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜