public void GetLocalTime_NullTimeString_ReturnsDateOnly() { string utcTimeString = null; DateTime currentDate = new DateTime(2015, 02, 15); DateTime expectedLocalTime = new DateTime(2015, 02, 15, 0, 0, 0); DateTime result = SunsetTDD.GetLocalTime(utcTimeString, currentDate); Assert.AreEqual(expectedLocalTime, result); }
public void GetLocalTime_UTCTimeString_ReturnsLocalTime() { string utcTimeString = "1:35:58 AM"; DateTime currentDate = new DateTime(2015, 02, 15); DateTime expectedLocalTime = new DateTime(2015, 02, 15, 18, 35, 58); DateTime result = SunsetTDD.GetLocalTime(utcTimeString, currentDate); Assert.AreEqual(expectedLocalTime, result); }