Пример #1
0
        public void Constructor_DateTimeTest()
        {
            var datetime = new DateTime(2018, 5, 6, 11, 22, 33, DateTimeKind.Utc);
            var utc      = new DateTimeUtc(datetime);

            Assert.Equal(datetime, utc.ToDateTimeUnsafe());
        }
Пример #2
0
        public void Constructor_DateAndTimeMillisecondsTest()
        {
            var utc = new DateTimeUtc(2018, 5, 6, 11, 22, 33, 456);

            Assert.Equal(new DateTime(2018, 5, 6, 11, 22, 33, 456, DateTimeKind.Utc),
                         utc.ToDateTimeUnsafe());
        }
Пример #3
0
        public void Constructor_DateTest()
        {
            var utc = new DateTimeUtc(2018, 5, 6);

            Assert.Equal(new DateTime(2018, 5, 6, 0, 0, 0, 0, DateTimeKind.Utc),
                         utc.ToDateTimeUnsafe());
        }
Пример #4
0
        public void Constructor_DateTimeOffsetTest()
        {
            var datetimeOffset = new DateTimeOffset(2018, 5, 6, 11, 22, 33, 456, TimeSpan.FromHours(9));
            var utc            = new DateTimeUtc(datetimeOffset);

            Assert.Equal(new DateTime(2018, 5, 6, 2, 22, 33, 456, DateTimeKind.Utc),
                         utc.ToDateTimeUnsafe());
        }