How to run SpecFlow tests in Visual Studio 2010?

后端 未结 8 1616
伪装坚强ぢ
伪装坚强ぢ 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:20

    I have written a blog post on how to use a batch file as an external tool to automatically run SpecFlow features in NUnit and generate a html report. See: http://watirmelon.com/2011/02/18/c-sharp-atdd-on-a-shoestring/

    0 讨论(0)
  • 2020-12-23 17:23

    If you want to be able to run your tests directly from Visual Studio 2010 without any additional tools or extensions than you should configure SpecFlow to use MsTest as its unit test framework.

    This can be done in your application configuration file with the following:

      <configSections> 
        <section 
           name="specFlow" 
           type="TechTalk.SpecFlow.Configuration.ConfigurationSectionHandler, TechTalk.SpecFlow"/> 
      </configSections> 
      <specFlow> 
        <unitTestProvider name="MsTest" /> 
        <!--
            Use this if you're running VS2010
            <unitTestProvider name="MsTest.2010" />
        -->
      </specFlow> 
    

    The generated code-behind file will then contain MsTest tests that are recognisable by Visual Studio and can be run with the build-it test runner.

    No need to use NUnit at all.

    0 讨论(0)
提交回复
热议问题