it:ad:specflow:howto:configure_it_for_mstest_rather_than_nunit

IT:AD:SpecFlow:HowTo:Configure it for MSTest rather than NUnit

Q: How do I get SpecFlow to use MSTest rather than NUnit tests?

Assuming your SpecFlow Features and Steps will be in an separate assembly, just add an app.config to the dll that contains the Features:

<configSections> 
  <section 
    name="specFlow" 
    type="TechTalk.SpecFlow.Configuration.ConfigurationSectionHandler,  
          TechTalk.SpecFlow"/> 
</configSections>


<configSections>  
  <specFlow> 
    <unitTestProvider name="MsTest" /> 
  <specFlow> 
</configSections>  

Once that’s done, touch/edit a feature so that it gets rebuilt – this time decorated with MSTest attributes instead of NUnit attributes.

One other point worth mentioning…In case you started the assembly as a lpain old dll project, and not a MSBuild project, you’ll find you have a little more work to do before things work…

Unload the dll project so that you can edit its *.csproj.

Add the following to the file, right after the FileAlignment element (near the top):

<ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}<ProjectTypeGuids> 

 

Then reload the project.

Note that the Guids mean:

{3AC096D0-A1C2-E12C-1390-A8335801FDAB} - Test Project
{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - C# Class Library
 
  • /home/skysigal/public_html/data/pages/it/ad/specflow/howto/configure_it_for_mstest_rather_than_nunit.txt
  • Last modified: 2023/11/04 23:02
  • by 127.0.0.1