예제 #1
0
        public void CheckIsDateNewer()
        {
            Assert.IsTrue(DateExtensions.IsDateNewerByOneSecond(DateTime.Now, DateTime.Today));
            Assert.IsTrue(DateExtensions.IsDateNewerByOneSecond(DateTime.Today, DateTime.MinValue));
            var santaClassIsComing             = new DateTime(2013, 12, 24, 23, 0, 0);
            var santaClassIsComingTinyBitLater = new DateTime(2013, 12, 24, 23, 0, 0, 500);
            var santaClassIsComingEvenLater    = new DateTime(2013, 12, 24, 23, 0, 1, 500);

            Assert.IsFalse(DateExtensions.IsDateNewerByOneSecond(santaClassIsComingTinyBitLater,
                                                                 santaClassIsComing));
            Assert.IsTrue(DateExtensions.IsDateNewerByOneSecond(santaClassIsComingEvenLater,
                                                                santaClassIsComing));
        }