public void CanCalculateDateTimeOffsetDifference() { var dateOffset = DateTimeOffset.Now; Assert.That(DateTimes.Difference(dateOffset, dateOffset.AddSeconds(90)), Is.EqualTo(TimeSpan.FromSeconds(90))); }
public void FailsOnNonDateTimeTypes() { Assert.Throws <ArgumentException>(() => DateTimes.Difference(10, 100)); }
public void CanCalculateTimeSpanDifference() { Assert.That(DateTimes.Difference(TimeSpan.FromSeconds(10), TimeSpan.FromSeconds(100)), Is.EqualTo(TimeSpan.FromSeconds(90))); }