예제 #1
0
        public void GivenRetryBehaviorWhenAttemptShouldCalculateDelay(
            int coeficient,
            int attempt,
            int delay)
        {
            var behavior = new ConstantRetryBehavior(coeficient);

            var timeSpan = behavior.GetWaitTime(attempt);

            timeSpan.Should().Be(TimeSpan.FromMinutes(delay));
        }
예제 #2
0
        public void GivenRetryBehaviorShouldVerifyIfCanRetry(int attempt, int maxAttempts, bool shouldRetry)
        {
            var behavior = new ConstantRetryBehavior(1);

            behavior.ShouldRetry(attempt, maxAttempts).Should().Be(shouldRetry);
        }