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