コード例 #1
0
        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"));
        }
コード例 #2
0
        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"));
        }
コード例 #3
0
        public void InvalidTimeSpanFormat()
        {
            var resolver = new DateTimeResolver("996ICU");
            var utc      = new DateTime(2000, 1, 1, 0, 0, 0);

            Assert.Throws <FormatException>(() =>
            {
                resolver.ToTimeZone(utc);
            });
        }