Exemple #1
0
        public void ResponseCodeIsNotConsideredTransient(HttpStatusCode code)
        {
            var strategy = new HttpStatusCodeErrorDetectionStrategy();

            Assert.False(strategy.IsTransient(new HttpRequestWithStatusException {
                StatusCode = code
            }));
        }
Exemple #2
0
        public bool IsTransient(Exception ex)
        {
            if (ex is HttpRequestWithStatusException)
            {
                return(_httpStatusCodeErrorDetectionStrategy.IsTransient(ex));
            }

            return(HelixApi.IsRetryableHttpException(ex));
        }
Exemple #3
0
        public void BadExceptionIsNotConsideredTransient()
        {
            var strategy = new HttpStatusCodeErrorDetectionStrategy();

            Assert.False(strategy.IsTransient(new InvalidOperationException()));
        }