public void should_add_1_plus_1_correctly() { Calculator calculator = null; Feature.AddScenario() .Given("a calculator", () => calculator = new Calculator()) .And("I have entered 1 into the calculator", () => calculator.Enter(1)) .And("I have entered 1 into the calculator", () => calculator.Enter(1)) .When("I add the numbers", () => calculator.Add()) .Then("the sum should be 2", () => calculator.Value().ShouldEqual(2)); }
protected void Given_a_calculator() { _calculator = new Calculator(); }