public void When_Duration_Exceeded_Timeout_Returns_True_Multiple_Tries() { var lifespan = new Lifespan { CreationTime = DateTime.UtcNow, Duration = 500 }; Thread.Sleep(100); Assert.IsFalse(lifespan.TimedOut()); Thread.Sleep(600); Assert.IsTrue(lifespan.TimedOut()); }
public void When_Duration_Exceeded_Timeout_Returns_True() { var lifespan = new Lifespan { CreationTime = DateTime.UtcNow, Duration = 250 }; Thread.Sleep(500); Assert.IsTrue(lifespan.TimedOut()); }
public void When_Duration_NotExceeded_Timeout_Returns_False() { var lifespan = new Lifespan { CreationTime = DateTime.UtcNow, Duration = 500 }; Thread.Sleep(250); Assert.IsFalse(lifespan.TimedOut()); }
/// <summary> /// True if the request exceeded it's <see cref="ClientConfiguration.AnalyticsRequestTimeout" />. /// </summary> /// <returns> /// <c>true</c> if the request times out; otherwise <c>false</c>. /// </returns> public bool TimedOut() { // BUG: will throw exception if called before Lifespan has been set return(Lifespan.TimedOut()); }
/// <summary> /// True if the request exceeded it's <see cref="ClientConfiguration.AnalyticsRequestTimeout" />. /// </summary> /// <returns> /// <c>true</c> if the request times out; otherwise <c>false</c>. /// </returns> public bool TimedOut() { return(Lifespan.TimedOut()); }