public void ProgressiveTimeoutInterrupter_FailSingleTest() { var target = new ProgressiveTimeoutInterrupter <long>(); target.Fail(null, DispatcherAvailability.NotChecked); DateTime?timeoutEndTime = target.GetTimeoutEndUtc(); Assert.AreEqual(null, timeoutEndTime); }
public void ProgressiveTimeoutInterrupter_FailManyMaxTest() { var target = new ProgressiveTimeoutInterrupter <long>(); for (int i = 0; i < 100; i++) { target.Fail(null, DispatcherAvailability.NotChecked); } DateTime?timeoutEndTime = target.GetTimeoutEndUtc(); DateTime expected = DateTime.UtcNow.Add(target.TimeoutMaxDuration); timeoutEndTime.Value.ShouldBe(expected, TimeSpan.FromSeconds(1)); }