public void RetryProxy_Fail_ExceedMaxAttempts() { var instance = new RetryTester(); var retryProxy = RetryProxy.Create <IRetryTester>(instance, new RetryOptions(1, TimeSpan.FromSeconds(60))); retryProxy.Fail(); }
public void RetryProxy_Fail_NotTransientByEnumerable() { var instance = new RetryTester(); var retryProxy = RetryProxy.Create <IRetryTester>(instance, new RetryOptions(5, TimeSpan.FromSeconds(60)), exceptionWhiteList: new Type[] { typeof(NullReferenceException) }); retryProxy.Fail(); }
public void RetryProxy_Fail_TransientEnumerationEvaluatesTrue() { var instance = new RetryTester(); var retryProxy = RetryProxy.Create <IRetryTester>(instance, new RetryOptions(1, TimeSpan.FromSeconds(5)), exceptionWhiteList: new Type[] { typeof(RetryTestException) }); retryProxy.Fail(); }
public void RetryProxy_Fail_NotTransientByFunction() { var instance = new RetryTester(); var retryProxy = RetryProxy.Create <IRetryTester>(instance, new RetryOptions(5, TimeSpan.FromSeconds(5)), exceptionBlackList: new Type[] { typeof(RetryTestException) }); retryProxy.Fail(); }
public void RetryProxy_Success() { var instance = new RetryTester(); var retryProxy = RetryProxy.Create <IRetryTester>(instance, new RetryOptions(5, TimeSpan.FromSeconds(5)), exceptionWhiteList: new Type[] { typeof(RetryTestException) }); var result = retryProxy.Succeed(); Assert.AreEqual("succeed", result); }