Exemplo n.º 1
0
        public RetryParams ExceptionHandler(Exception ex, int currentRetryCount)
        {
            ExceptionReceived = ex;
            LatestRetryCount  = currentRetryCount;

            return(RetryParams.DefaultBackOff(currentRetryCount));
        }
        public void RetryParams_DefaultBackOffShouldRetryOnFirstRetry()
        {
            RetryParams retryParams = RetryParams.DefaultBackOff(0);

            // If this is the first time we retry, it should retry by default
            Assert.True(retryParams.ShouldRetry);
            Assert.Equal(TimeSpan.FromMilliseconds(50), retryParams.RetryAfter);
        }
        public void RetryParams_DefaultBackOffShouldNotRetryAfter5Retries()
        {
            RetryParams retryParams = RetryParams.DefaultBackOff(10);

            Assert.False(retryParams.ShouldRetry);
        }