How to run SpecFlow tests in Visual Studio 2010?

后端 未结 8 1734
伪装坚强ぢ
伪装坚强ぢ 2020-12-23 16:57

Trying to get SpecFlow running with a fresh VS2010 Professional install. Created a new console application and added references to NUnit and SpecFlow. Created a SpecFlow fea

8条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-23 17:14

    SpecFlow does not provide a runner itself.
    SpecFlow generates fixtures for one of the common Unit-Test-Frameworks. In SpecFlow 1.3 NUnit (default), MSTest and xUnit.net are supported (configured in the App.config).

    To run the fixtures you have to use a runner that is capable of running them. ReSharper is a very good option for a test runner that is integratied in VisualStudio, but it is not free. ReSharper gives you the "Run Unit Tests" context menu in the solution explorer, you are referring to.

    An alternative for VisualStudio integration is TestDriven.Net (also providing a context menu).

    For NUnit you can also use the runners that come with NUnit itself (there is a GUI-Runner and a commandline runner).
    For MSTest you can use the native VisualStudio integration for running tests (however I find that one a bit clumsy).
    xUnit.net also comes with its runners, however I am not familiar with them.

    Furthermore, you can use MSBuild tasks to run the fixtures ...

提交回复
热议问题