Skip to content

Instantly share code, notes, and snippets.

@gasparnagy
Created February 20, 2017 06:56
Show Gist options
  • Save gasparnagy/d4ecf471f56241a855faa5c6d25dc7f5 to your computer and use it in GitHub Desktop.
Save gasparnagy/d4ecf471f56241a855faa5c6d25dc7f5 to your computer and use it in GitHub Desktop.
[Binding]
public class CalculatorSteps
{
private readonly Calculator calculator = new Calculator();
[Given(@"I have entered (.*) into the calculator")]
public void GivenIHaveEnteredIntoTheCalculator(int operand)
{
calculator.Enter(operand);
}
[When(@"I press add")]
public void WhenIPressAdd()
{
calculator.Add();
}
//...
[Then(@"the result should be (.*) on the screen")]
public void ThenTheResultShouldBeOnTheScreen(int expectedResult)
{
Assert.Equal(expectedResult, calculator.Result);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment