예제 #1
0
        public void Backend_UTCConvensionsBackend_ToClientTime_Valid_Date_Already_Local_Should_Pass()
        {
            //arrange
            var inputDateTime  = DateTime.Now;
            var expectDateTime = DateTime.Now;

            //act
            var result = UTCConversionsBackend.ToClientTime(inputDateTime);

            //assert
            Assert.AreEqual(expectDateTime.Minute, result.Minute, TestContext.TestName);
            Assert.AreEqual(expectDateTime.Hour, result.Hour, TestContext.TestName);
        }
예제 #2
0
        public void Backend_UTCConvensionsBackend_ToClientTime_Valid_Date_UTC_timeOffSet_Is_Null_Should_Pass()
        {
            //arrange
            var inputDateTime = DateTime.Now;

            inputDateTime = DateTime.SpecifyKind(inputDateTime, DateTimeKind.Unspecified);
            var expectDateTime = DateTime.UtcNow;

            //act
            var result = UTCConversionsBackend.ToClientTime(inputDateTime);

            //assert
            Assert.AreEqual(expectDateTime.Minute, result.Minute, TestContext.TestName);
            Assert.AreEqual(expectDateTime.Hour, result.Hour, TestContext.TestName);
        }