示例#1
0
        public void TestGetDateTimeWithUserTZone()
        {
            var tSpan    = "02:51:00";
            var resolver = new DateTimeResolver(tSpan);

            var utc = new DateTime(2000, 1, 1, 0, 0, 0);
            var dt  = resolver.GetDateTimeWithUserTZone(utc);

            Assert.IsTrue(dt == DateTime.Parse("2000/1/1 2:51:00"));
        }
        public void TestGetDateTimeWithUserTZone()
        {
            var tSpan = "02:51:00";

            _blogConfigMock.Setup(m => m.GeneralSettings).Returns(new GeneralSettings
            {
                TimeZoneUtcOffset = tSpan
            });

            var resolver = new DateTimeResolver(_blogConfigMock.Object);

            var utc = new DateTime(2000, 1, 1, 0, 0, 0);
            var dt  = resolver.GetDateTimeWithUserTZone(utc);

            Assert.IsTrue(dt == DateTime.Parse("2000/1/1 2:51:00"));
        }