예제 #1
0
		public void RetryStrategyShouldCompleteWhenHandlerThrows()
		{
			RetryStrategy s = new RetryStrategy();

			s.Retrying += (sender, re) => { throw new ApplicationException(); };

			Assert.Throws<AggregateException>(() => s.ExecuteWithRetryAsync<int>(null, () => Task<int>.Factory.StartNew(() => { throw new ApplicationException(); })).Wait());
		}
예제 #2
0
        public void RetryStrategyShouldCompleteWhenHandlerThrows()
        {
            RetryStrategy s = new RetryStrategy();

            s.Retrying += (sender, re) => { throw new Exception(); };

            Assert.Throws <AggregateException>(() => s.ExecuteWithRetryAsync <int>(null, () => Task <int> .Factory.StartNew(() => { throw new Exception(); })).Wait());
        }
예제 #3
0
		public void RetryStrategyShouldCompleteWhenFuncThrows()
		{
			RetryStrategy s = new RetryStrategy();

			Assert.Throws<AggregateException>(() => s.ExecuteWithRetryAsync<int>(null, () => { throw new ApplicationException(); }).Wait());
		}
예제 #4
0
		public void RetryStrategyShouldCompleteWhenFuncReturnsNullTask()
		{
			RetryStrategy s = new RetryStrategy();

			Assert.Throws<AggregateException>(() => s.ExecuteWithRetryAsync<int>(null, () => null).Wait());
		}
예제 #5
0
        public void RetryStrategyShouldCompleteWhenFuncThrows()
        {
            RetryStrategy s = new RetryStrategy();

            Assert.Throws <AggregateException>(() => s.ExecuteWithRetryAsync <int>(null, () => { throw new Exception(); }).Wait());
        }
예제 #6
0
        public void RetryStrategyShouldCompleteWhenFuncReturnsNullTask()
        {
            RetryStrategy s = new RetryStrategy();

            Assert.Throws <AggregateException>(() => s.ExecuteWithRetryAsync <int>(null, () => null).Wait());
        }