Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

No overload for method 'Given' takes 4 arguments - specflow

Tags:

nuget

specflow

I have installed specflow. And by default I get this scenario to add two numbers. when I build the solution, i get these errors. "No overload for method 'Given' takes 4 arguments". What is that I am missing here? this is the generated file.

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();
        }

For this scenario:

Feature: SpecFlowFeature1 In order to avoid silly mistakes As a math idiot I want to be told the sum of two numbers

@mytag Scenario: Add two numbers Given I have entered 50 into the calculator And I have entered 70 into the calculator When I press add Then the result should be 120 on the screen

like image 552
Virus Avatar asked Nov 19 '25 17:11

Virus


1 Answers

It was a problem of techtalk.specflow.dll version. I had 1.8.1 version which I replaced with 1.9.0 and everything worked ! Thank u for ur suggestions

like image 125
Virus Avatar answered Nov 24 '25 16:11

Virus