public void ThrowIfExpired_should_not_throw_when_the_timeout_has_not_expired() { var subject = new SlidingTimeout(TimeSpan.FromSeconds(10), _clock); Action act = () => subject.ThrowIfExpired(); act.ShouldNotThrow(); }
public void ThrowIfExpired_should_throw_when_the_timeout_has_expired() { var subject = new SlidingTimeout(TimeSpan.FromSeconds(10), _clock); _clock.UtcNow = _clock.UtcNow.AddSeconds(11); Action act = () => subject.ThrowIfExpired(); act.ShouldThrow <TimeoutException>(); }
public void ThrowIfExpired_should_throw_when_the_timeout_has_expired() { var subject = new SlidingTimeout(TimeSpan.FromSeconds(10), _clock); _clock.UtcNow = _clock.UtcNow.AddSeconds(11); Action act = () => subject.ThrowIfExpired(); act.ShouldThrow<TimeoutException>(); }