Specflow 2.3.2:为什么 Specflow 使用 "Microsoft.VisualStudio.TestTools" 而不是 "NUnit.Framework" 生成 *.cs 文件

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

问题:为什么 Specflow 使用 Microsoft.VisualStudio.TestTools.UnitTesting.TestClassAttribute() 生成功能文件背后的 *.cs 代码而不是 NUnit.Framework?下面描述的两种解决方案都使用我所看到的相同的 NuGet 包。


详情:

我有一个项目生成 Specflow 代码隐藏 *.cs 文件并且只使用 NUnit。

有第二个项目(在单独的解决方案中)始终使用 "Microsoft.VisualStudio.TestTools.UnitTesting.TestClassAttribute()" 而不是使用 NUnit Fromework。

我在第二个解决方案中搜索了单词 "VisualStudio.TestTools",它唯一出现的地方是 TechTalk.SpecFlow.Reporting.dll。

问题:为什么 Specflow 使用 Microsoft.VisualStudio.TestTools.UnitTesting.TestClassAttribute() 生成功能文件背后的 *.cs 代码而不是 NUnit.Framework?据我所知,这两种解决方案都使用相同的 NuGet 包。

在 Specflow 2.3.2 中,您需要在 App.config 中包含此 "unitTestProvider"。但是是的,你应该升级到 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>