public void GetDateTime_UserTZoneZero() { var resolver = new DateTimeResolver(string.Empty); var utc = new DateTime(2000, 1, 1, 0, 0, 0); var dt = resolver.ToTimeZone(utc); Assert.IsTrue(dt == DateTime.Parse("2000/1/1 0:00:00")); }
public void GetDateTime_UserTZone() { var tSpan = "02:51:00"; var resolver = new DateTimeResolver(tSpan); var utc = new DateTime(2000, 1, 1, 0, 0, 0); var dt = resolver.ToTimeZone(utc); Assert.IsTrue(dt == DateTime.Parse("2000/1/1 2:51:00")); }
public void InvalidTimeSpanFormat() { var resolver = new DateTimeResolver("996ICU"); var utc = new DateTime(2000, 1, 1, 0, 0, 0); Assert.Throws <FormatException>(() => { resolver.ToTimeZone(utc); }); }