public string convertTime(string aTime) { //try parsing input time Time time; if (!Time.TryParse(aTime, out time)) { return("Unknown time format"); } return(GetLine1(time) + GetLine2(time) + GetLine3(time) + GetLine4(time) + GetLine5(time)); }
public string ConvertTimeRepresentation(string iso8601Time) { string result; if (Time.TryParse(iso8601Time, out Time time)) { IClock clock = new Models.BerlinClock(time); result = clock.GetTimeString(); } else { throw new ApplicationException(ErrorMessages.IncorrectTimeFormat); } return(result); }
public void TryParse_Must_Return_False_And_Output_Default_Value(string time) { Assert.IsFalse(Time.TryParse(time, out Time result)); Assert.AreEqual(default(Time), result); }
public void TryParse_Must_Return_True_And_Output_Expected(string time, Time expected) { Assert.IsTrue(Time.TryParse(time, out Time result)); Assert.AreEqual(expected, result); }