Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using TechTalk.SpecFlow;
- using Microsoft.VisualStudio.TestTools.UnitTesting;
- namespace MyNamespace {
- [Binding]
- public class StepDefinitions {
- public int NumberToAdd { get; private set; }
- private StepDefinitions() {
- NumberToAdd = 0;
- }
- [Given(@"I have entered (.*) into the calculator")]
- public void GivenIHaveEnteredIntoTheCalculator(int numberToAdd) {
- NumberToAdd += numberToAdd;
- }
- [When(@"I press add")]
- public void WhenIPressAdd() {
- //nothing to do
- }
- [Then(@"the result should be (.*) on the screen")]
- public void ThenTheResultShouldBeOnTheScreen(int expectedSum) {
- Assert.AreEqual(expectedSum, NumberToAdd);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement