public void WhenInputInCorrectFormatButSecondsBiggerThant59ExpectArgumentException() { string input = "13:30:60"; textInputConverter = new TextTimeFormatInputConversionService(); Assert.Throws(typeof(ArgumentException), () => textInputConverter.Convert(input)); }
public void WhenInputInCorrectFormatButHourBiggerThan24ExpectArgumentException() { string input = "25:11:11"; textInputConverter = new TextTimeFormatInputConversionService(); Assert.Throws(typeof(ArgumentException), () => textInputConverter.Convert(input)); }
public void WhenInputInIncorrectFormatExpectArgumentException() { string input = "SD:rr,ewewe"; textInputConverter = new TextTimeFormatInputConversionService(); Assert.Throws(typeof(ArgumentException), () => textInputConverter.Convert(input)); }
public void WhenInputIsEmptyExpectArgumentException() { string input = string.Empty; textInputConverter = new TextTimeFormatInputConversionService(); Assert.Throws(typeof(ArgumentException), () => textInputConverter.Convert(input)); }
public void WhenInputInCorrectFormatGetTimeSpanRepresentingPassesAsInputTime() { string input = "13:25:32"; textInputConverter = new TextTimeFormatInputConversionService(); TimeSpan result = textInputConverter.Convert(input); Assert.AreEqual("13", result.Hours.ToString()); Assert.AreEqual("25", result.Minutes.ToString()); Assert.AreEqual("32", result.Seconds.ToString()); }
public TimeConverter(ITimeTextInputConverter inputConverterService, IBerlineClockService berlinClockService, IBerlinClockVisualisationService visualisationService) { this.berlinClockService = berlinClockService; this.visualisationService = visualisationService; this.inputConverterService = inputConverterService; }