public void TreatsAll4xAnd5xAsErrors() { var classifier = new ResponseClassifier(); var httpMessage = new HttpMessage(new MockRequest(), new ResponseClassifier()); for (int i = 400; i < 600; i++) { httpMessage.Response = new MockResponse(i); Assert.True(classifier.IsErrorResponse(httpMessage)); } }
public override bool IsErrorResponse(HttpMessage message) { if (Applies(message, ResponseClassification.Throw)) { return(true); } if (Applies(message, ResponseClassification.Success)) { return(false); } return(_inner.IsErrorResponse(message)); }