示例#1
0
        public void RetrytHandlerOption_ShouldUseDefaultValuesIfNotSpecified()
        {
            var retryOptions = new RetryHandlerOption();

            Assert.Equal(RetryHandlerOption.DEFAULT_DELAY, retryOptions.Delay);
            Assert.Equal(RetryHandlerOption.DEFAULT_MAX_RETRY, retryOptions.MaxRetry);
            Assert.True(retryOptions.ShouldRetry(0, 0, null));
            Assert.Equal(TimeSpan.Zero, retryOptions.RetriesTimeLimit);
        }
示例#2
0
        public void RetrytHandlerOption_ShouldAcceptCorrectValue()
        {
            int delay        = 20;
            int maxRetry     = 5;
            var retryOptions = new RetryHandlerOption()
            {
                Delay = delay, MaxRetry = maxRetry, ShouldRetry = ShouldRetry
            };

            Assert.Equal(delay, retryOptions.Delay);
            Assert.Equal(maxRetry, retryOptions.MaxRetry);
            Assert.Equal(ShouldRetry, retryOptions.ShouldRetry);
        }