简体   繁体   中英

Specflow 2.3.2: why is Specflow generating *.cs files using “Microsoft.VisualStudio.TestTools” instead of “NUnit.Framework”

Question : why is Specflow using Microsoft.VisualStudio.TestTools.UnitTesting.TestClassAttribute() to generate the *.cs code behind for the feature files instead of the NUnit.Framework? Both solutions described below use the same NuGet packages from what I can see.


Details :

I have one project that generates the Specflow codebehind *.cs files and only uses NUnit. 使用所有NUnit的Specflow代码背后

There is a second project (in a separate solution) which always uses "Microsoft.VisualStudio.TestTools.UnitTesting.TestClassAttribute()" instead of using the NUnit Fromework. 背后总是想使用MS TestTools单元测试的Specflow代码

I did a search in the second solution for the words "VisualStudio.TestTools" and the only place it showed up was in the TechTalk.SpecFlow.Reporting.dll.

Question : why is Specflow using Microsoft.VisualStudio.TestTools.UnitTesting.TestClassAttribute() to generate the *.cs code behind for the feature files instead of the NUnit.Framework? Both solutions use the same NuGet packages from what I can see.

In Specflow 2.3.2 you need to have this "unitTestProvider" in your App.config. But yeah you should probably just upgrade to 3.0

<specFlow>
<plugins>
  <add name="SpecRun" />
  <!--<add name="SpecFlow.Retry" path="..\packages\SpecFlow.Retry.2.4.0\lib\net45" type="Generator" />-->
</plugins>

<!-- For additional details on SpecFlow configuration options see http://go.specflow.org/doc-config -->
<!-- use unit test provider SpecRun+NUnit or SpecRun+MsTest for being able to execute the tests with SpecRun and another provider -->
<unitTestProvider name="SpecRun+NUnit" />
</specFlow>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM