[英]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? 问题 :为什么Specflow使用Microsoft.VisualStudio.TestTools.UnitTesting.TestClassAttribute()为功能文件而不是NUnit.Framework生成* .cs代码? Both solutions described below use the same NuGet packages from what I can see. 从我所见,下面介绍的两种解决方案都使用相同的NuGet软件包。
Details : 详细资料 :
I have one project that generates the Specflow codebehind *.cs files and only uses NUnit. 我有一个项目在* .cs文件后面生成Specflow代码,并且仅使用NUnit。
There is a second project (in a separate solution) which always uses "Microsoft.VisualStudio.TestTools.UnitTesting.TestClassAttribute()" instead of using the NUnit Fromework. 还有另一个项目(在单独的解决方案中),该项目始终使用“ Microsoft.VisualStudio.TestTools.UnitTesting.TestClassAttribute()”,而不是使用NUnit Fromework。
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. 我在第二个解决方案中搜索了“ VisualStudio.TestTools”一词,它显示的唯一位置是在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? 问题 :为什么Specflow使用Microsoft.VisualStudio.TestTools.UnitTesting.TestClassAttribute()为功能文件而不是NUnit.Framework生成* .cs代码? Both solutions use the same NuGet packages from what I can see. 从我所见,这两种解决方案都使用相同的NuGet软件包。
In Specflow 2.3.2 you need to have this "unitTestProvider" in your App.config. 在Specflow 2.3.2中,您需要在App.config中具有此“ unitTestProvider”。 But yeah you should probably just upgrade to 3.0 但是,是的,您可能应该升级到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>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.