I am trying to write a StepArgumentTransformation for specflow.
I have following gherkin
Scenario: Test Arguments
Given user enter once as 2
And I have written this in step definition.
[StepArgumentTransformation]
public int GetOnces(string onces, string times)
{
return 1 * int.Parse(times);
}
[Given(@"user enter (.*) as (.*)")]
public void GivenUserEnterOnce(int num)
{
Assert.Equal(2, num);
}
But GetOnces method is never called and I get the exception
TechTalk.SpecFlow.BindingException: 'Parameter count mismatch! The binding method 'GivenUserEnterOnce(Int32)' should have 2 parameters