Пример #1
0
        public void ResponseCodeIsNotConsideredTransient(HttpStatusCode code)
        {
            var strategy = new HttpStatusCodeErrorDetectionStrategy();

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

            return(HelixApi.IsRetryableHttpException(ex));
        }
Пример #3
0
        public void BadExceptionIsNotConsideredTransient()
        {
            var strategy = new HttpStatusCodeErrorDetectionStrategy();

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