public void WebRequestTransientErrorDetectionStrategyDataServiceClientExceptionTest() { HttpStatusCode[] allHttpStatusCodeValues = (HttpStatusCode[])Enum.GetValues(typeof(HttpStatusCode)); WebRequestTransientErrorDetectionStrategy strategy = new WebRequestTransientErrorDetectionStrategy(); foreach (HttpStatusCode status in allHttpStatusCodeValues) { DataServiceClientException exception = QueryErrorDetectionStrategyTest.GetMockedClientException(status); Assert.IsFalse(strategy.IsTransient(exception)); } }
public void SaveChangesErrorDetectionStrategyDataServiceClientExceptionTest() { HttpStatusCode[] allHttpStatusCodeValues = (HttpStatusCode[])Enum.GetValues(typeof(HttpStatusCode)); SaveChangesErrorDetectionStrategy strategy = new SaveChangesErrorDetectionStrategy(); foreach (HttpStatusCode status in allHttpStatusCodeValues) { DataServiceClientException exception = QueryErrorDetectionStrategyTest.GetMockedClientException(status); if (strategy.IsTransient(exception)) { Assert.IsTrue(SupportedRetryableHttpStatusCodes.Contains(status), status.ToString()); } else { Assert.IsFalse(SupportedRetryableHttpStatusCodes.Contains(status), status.ToString()); } } }