Kir*_*eed 6 resharper specflow
我刚刚添加了一个specflow功能,但生成的代码适用于NUnit.我更愿意使用Resharper来运行测试.
我从NuGet安装了specflow.我没有安装任何跑步项目.
以下是生成的.feature.cs示例
//
------------------------------------------------------------------------------ // <auto-generated> // This code was generated by SpecFlow (http://www.specflow.org/). // SpecFlow Version:1.9.0.77 // SpecFlow Generator Version:1.9.0.0 // Runtime Version:4.0.30319.18444 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // </auto-generated> //
------------------------------------------------------------------------------
#region Designer generated code
#pragma warning disable namespace Test.FeatureHanding {
using TechTalk.SpecFlow;
[System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "1.9.0.77")]
[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[NUnit.Framework.TestFixtureAttribute()]
[NUnit.Framework.DescriptionAttribute("Set Filter")
Run Code Online (Sandbox Code Playgroud)
AlS*_*Ski 10
默认情况下,所有SpecFlow测试都在NUnit中!SpecFlow只是为您生成纯文本测试.
您只需在生成的YourFeature.feature.cs文件中单击测试方法声明左侧的图标,或者单击Resharpers测试资源管理器以查找它.
我认为这里有一个术语误解.
NUnit是一个测试框架(其他是xUnit,mbUnit,MSTest).NUnit附带了一个测试运行器,可以运行用NUnit框架编写的单元测试.
Resharper有一个测试运行器,可以运行许多测试框架的测试(我相信所有上述框架).还有其他测试跑步者可用.Visual Studio(2012+我相信)带有一个测试运行器,可以在没有插件的情况下运行MSTest测试.NCrunch可以从任何框架运行测试,xUnit和mbUnit可能提供了可以运行在这些框架中编写的测试的运行程序.
一旦构建了功能文件,Resharper就会找到SpecFlow生成的测试.