예제 #1
0
        public void CanCalculateDateTimeOffsetDifference()
        {
            var dateOffset = DateTimeOffset.Now;

            Assert.That(DateTimes.Difference(dateOffset, dateOffset.AddSeconds(90)), Is.EqualTo(TimeSpan.FromSeconds(90)));
        }
예제 #2
0
 public void FailsOnNonDateTimeTypes()
 {
     Assert.Throws <ArgumentException>(() => DateTimes.Difference(10, 100));
 }
예제 #3
0
 public void CanCalculateTimeSpanDifference()
 {
     Assert.That(DateTimes.Difference(TimeSpan.FromSeconds(10), TimeSpan.FromSeconds(100)), Is.EqualTo(TimeSpan.FromSeconds(90)));
 }