简体   繁体   English

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”

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。 使用所有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. 还有另一个项目(在单独的解决方案中),该项目始终使用“ Microsoft.VisualStudio.TestTools.UnitTesting.TestClassAttribute()”,而不是使用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. 我在第二个解决方案中搜索了“ 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.

相关问题 在NUnit.Framework和Microsoft.VisualStudio.TestTools.UnitTesting命名空间中也发现了NUnit断言方法错误 - NUnit Assert method error as it is found in NUnit.Framework and Microsoft.VisualStudio.TestTools.UnitTesting namespace as well Mono和Specflow - `TestCaseAttribute&#39;在名称空间`NUnit.Framework&#39;中不存在 - Mono and Specflow - `TestCaseAttribute' does not exist in the namespace `NUnit.Framework' 使用Xunit运行Specflow但是给出错误nunit.framework - Run Specflow with Xunit but gives error nunit.framework Specflow 功能不会自动生成 cs 文件或在 C# Nunit 项目中显示为测试 - Specflow features aren't auto-generating cs files or appearing as tests in C# Nunit project Nunit Framework与SpecFlow框架 - Nunit Framework vs SpecFlow Framework 定义使用Microsoft.VisualStudio.TestTools.UnitTesting或NUnit时需要多少个断言 - Define how many asserts are expected when using Microsoft.VisualStudio.TestTools.UnitTesting or NUnit 使用Nunit和Specflow报告生成蛋糕 - Cake build with the Nunit and Specflow report generating 为什么我的SpecFlow Feature.cs文件中没有显示Parallelizable属性 - Why is Parallelizable attribute not showing in my SpecFlow feature.cs files 使用Specflow和NUnit版本3在paralel中运行测试 - Using Specflow and NUnit version 3 to run tests in paralel 仅安装 Specflow.MSTest 包时,Specflow 3.0 会错误地生成 NUnit 测试 - Specflow 3.0 incorrectly generating NUnit tests when only Specflow.MSTest package is installed
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM