public void AgoUTC() { using (ThreadLocalServiceLocator.Push(new FreezingClockLocator())) { var past = 10.Days().Ago(DateTimeKind.Utc); var now = TimeSpanCalendarExtensions.Extensions.UtcNow; Assert.Equal(past, now.Subtract(TimeSpan.FromDays(10))); Assert.Equal(DateTimeKind.Utc, past.Kind); } }
public void FromNowUTC() { using (ThreadLocalServiceLocator.Push(new FreezingClockLocator())) { var future = 10.Days().FromNow(DateTimeKind.Utc); var now = TimeSpanCalendarExtensions.Extensions.UtcNow; Assert.Equal(future, now.AddDays(10)); Assert.Equal(DateTimeKind.Utc, future.Kind); } }