コード例 #1
0
ファイル: RetryProxyTests.cs プロジェクト: chandusekhar/Core
        public void RetryProxy_Fail_ExceedMaxAttempts()
        {
            var instance   = new RetryTester();
            var retryProxy = RetryProxy.Create <IRetryTester>(instance, new RetryOptions(1, TimeSpan.FromSeconds(60)));

            retryProxy.Fail();
        }
コード例 #2
0
ファイル: RetryProxyTests.cs プロジェクト: chandusekhar/Core
        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();
        }
コード例 #3
0
ファイル: RetryProxyTests.cs プロジェクト: chandusekhar/Core
        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();
        }
コード例 #4
0
ファイル: RetryProxyTests.cs プロジェクト: chandusekhar/Core
        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();
        }
コード例 #5
0
ファイル: RetryProxyTests.cs プロジェクト: chandusekhar/Core
        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);
        }