public void GetDateTime_UserTZoneZero() { var resolver = new BlogTZoneResolver(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 BlogTZoneResolver(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 BlogTZoneResolver("996ICU"); var utc = new DateTime(2000, 1, 1, 0, 0, 0); Assert.Throws <FormatException>(() => { resolver.ToTimeZone(utc); }); }