Created
November 13, 2016 17:20
-
-
Save angelovstanton/ce9b4669996d7ca4250cb6abd5c1790c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[When(@"type seconds for (.*)")] | |
public void WhenTypeSeconds(TimeSpan seconds) | |
{ | |
this.secondsToMinutesPage.ConvertSecondsToMintes(seconds.TotalSeconds); | |
} | |
[Then(@"assert that (.*) minutes are displayed as answer")] | |
public void ThenAssertThatSecondsAreDisplayedAsAnswer(int expectedMinutes) | |
{ | |
this.secondsToMinutesPage.AssertMinutes(expectedMinutes.ToString()); | |
} | |
[StepArgumentTransformation(@"(?:(\d*) day(?:s)?(?:, )?)?(?:(\d*) hour(?:s)?(?:, )?)?(?:(\d*) minute(?:s)?(?:, )?)?(?:(\d*) second(?:s)?(?:, )?)?")] | |
public TimeSpan TimeSpanTransform(string days, string hours, string minutes, string seconds) | |
{ | |
int daysParsed; | |
int hoursParsed; | |
int minutesParsed; | |
int secondsParsed; | |
int.TryParse(days, out daysParsed); | |
int.TryParse(hours, out hoursParsed); | |
int.TryParse(minutes, out minutesParsed); | |
int.TryParse(seconds, out secondsParsed); | |
return new TimeSpan(daysParsed, hoursParsed, minutesParsed, secondsParsed); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment