我已经安装了specflow。默认情况下,我得到这个场景来添加两个数字。当我构建解决方案时,我得到了这些错误。“方法 'Given' 没有重载需要 4 个参数”。我在这里想念什么?这是生成的文件。
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", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given ");
#line 9
testRunner.And("I have entered 70 into the calculator", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
#line 10
testRunner.When("I press add", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
#line 11
testRunner.Then("the result should be 120 on the screen", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
#line hidden
this.ScenarioCleanup();
}
对于这种情况:
Feature:SpecFlowFeature1 为了避免愚蠢的错误作为一个数学白痴,我想被告知两个数字的总和
@mytag 场景:添加两个数字给定我在计算器中输入了 50 我在计算器中输入了 70 当我按添加时,结果应该是屏幕上的 120