Visual Studio 2010 Proでは、NuGetと同じクラスライブラリのSpecFlowとNUnit(別途)があります。私が正しくのようにNUnitのを使用するデフォルトのテンプレート機能ファイル持ってSpecFlowはTools-> Options-> SpecFlow-> TestRunnerToolのNUnitを表示しません
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<section name="specFlow" type="TechTalk.SpecFlow.Configuration.ConfigurationSectionHandler, TechTalk.SpecFlow" />
</configSections>
<specFlow>
<!-- For additional details on SpecFlow configuration options see https://github.com/techtalk/SpecFlow/wiki/Configuration -->
<unitTestProvider name="NUnit" />
</specFlow>
</configuration>
:App.configファイルがある
[NUnit.Framework.TestAttribute()]
[NUnit.Framework.DescriptionAttribute("Add two numbers")]
[NUnit.Framework.CategoryAttribute("mytag")]
public virtual void AddTwoNumbers()
{
TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Add two numbers", new string[] {
"mytag"});
#line 7
this.ScenarioSetup(scenarioInfo);
#line 8
testRunner.Given("I have entered 50 into the calculator");
#line 9
testRunner.And("I have entered 70 into the calculator");
#line 10
testRunner.When("I press add");
#line 11
testRunner.Then("the result should be 120 on the screen");
#line hidden
this.ScenarioCleanup();
}
はツール - >オプション - > SpecFlow-> TestRunnerToolがautoに設定されているが、私はNUnitがドロップダウンに記載されていない参照してください。
フィーチャファイルを右クリックして、シナリオ(電卓とテンプレートからの2つの数値についてのデフォルトシナリオ)を実行しようとすると、「一致するテストランナーが見つかりませんでした。 「ツール/オプション/ SpecFlow」私はそのドロップダウン?それとも私がSpecFlowが機能ファイルを実行するために他に何ができるのでNUnitのを取得するにはどうすればよい
?
NUnit.Framework.dllランタイムバージョンは、2.0 V .50727 NUnit.Framework.dllバージョン2.6.0.12051
TechTalk.SpecFlow.dllランタイムバージョン2.0.50727 TechTalk.SpecFlow.dllバージョン1.8.1.0
したがって、プロジェクト(両方のDLL)がビルドされます。 Visual Studio内で右クリックの実行シナリオを使用する代わりに、NUnitを開いてそこからテストを実行しました。それは動作します。 – DFBerry