[Binding] public class MyTestSteps { private readonly ScenarioContext _scenarioContext; public MyTestSteps(ScenarioContext scenarioContext) { _scenarioContext = scenarioContext; } [Given(@"I have entered (.*) into the calculator")] public void GivenIHaveEnteredIntoTheCalculator(int number) { // store the number in scenario context _scenarioContext["number"] = number; } [When(@"I press add")] public void WhenIPressAdd() { // retrieve the stored number from scenario context and perform addition int number = (int)_scenarioContext["number"]; int result = Calculator.Add(number, 2); // store the result in scenario context _scenarioContext["result"] = result; } [Then(@"the result should be (.*) on the screen")] public void ThenTheResultShouldBeOnTheScreen(int expectedResult) { // retrieve the stored result from scenario context int result = (int)_scenarioContext["result"]; // assert that the result matches the expected result Assert.AreEqual(expectedResult, result); } }In this example, we store an integer in the ScenarioContext in the Given step, retrieve it and perform an addition in the When step, and then retrieve another integer and assert its equality in the Then step. The SpecFlow package library can be found at https://www.nuget.org/packages/SpecFlow/.