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

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