Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save AddressXception/c54b466eb4f92a09d0ecf6b588863ea4 to your computer and use it in GitHub Desktop.
Save AddressXception/c54b466eb4f92a09d0ecf6b588863ea4 to your computer and use it in GitHub Desktop.
[Binding]
public class TipCalcScreenSteps : StepsBase
{
private ITipCalcScreen _tipCalcScreen;
protected override void GetScreens()
{
_tipCalcScreen = FeatureContext
.Current
.Get<ITipCalcScreen>(ScreenNames.TipCalc);
}
[Given(@"I have selected the SubTotal field")]
public void GivenIHaveSelectedTheSubTotalField()
{
App.Tap(_tipCalcScreen.SubTotalEntry);
}
[When(@"I enter (.*) into the SubTotal field")]
public void WhenIEnterIntoTheSubTotalField(int p0)
{
App.EnterText(_tipCalcScreen.SubTotalEntry, p0.ToString());
}
[Then(@"the Tip Amount should be (.*) on the screen")]
public void ThenTheTipAmountShouldBeOnTheScreen(int p0)
{
var result = App.Query(_tipCalcScreen.TipAmount)[0].Text;
Assert.IsTrue(p0.ToString() == result,
$"the result {result} does not match the test value {p0}");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment