public void should_return_false_after_max_attempts(int attempt, int maxAttempts, bool expectedResult) { var testSubject = new DefaultRetryPredicate(maxAttempts); var response = new HttpResponseMessage(HttpStatusCode.InternalServerError); testSubject.ShouldRetry(attempt, response).ShouldBe(expectedResult); }
public void should_return_false_for_other_status_codes(HttpStatusCode statusCode) { var testSubject = new DefaultRetryPredicate(1); var response = new HttpResponseMessage(statusCode); testSubject.ShouldRetry(1, response).ShouldBe(false); }
public void should_return_true_if_response_not_specified(int attempt, int maxAttempts, bool expectedResult) { var testSubject = new DefaultRetryPredicate(maxAttempts); testSubject.ShouldRetry(attempt, null).ShouldBe(expectedResult); }