コード例 #1
0
        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());
        }
コード例 #2
0
        public void When_Duration_Exceeded_Timeout_Returns_True()
        {
            var lifespan = new Lifespan
            {
                CreationTime = DateTime.UtcNow,
                Duration     = 250
            };

            Thread.Sleep(500);
            Assert.IsTrue(lifespan.TimedOut());
        }
コード例 #3
0
        public void When_Duration_NotExceeded_Timeout_Returns_False()
        {
            var lifespan = new Lifespan
            {
                CreationTime = DateTime.UtcNow,
                Duration     = 500
            };

            Thread.Sleep(250);
            Assert.IsFalse(lifespan.TimedOut());
        }
コード例 #4
0
 /// <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());
 }
コード例 #5
0
 /// <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());
 }