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());
        }
		public void RetryStrategyShouldCompleteWhenFuncThrows()
		{
			RetryStrategy s = new RetryStrategy();

			Assert.Throws<AggregateException>(() => s.ExecuteWithRetryAsync<int>(null, () => { throw new ApplicationException(); }).Wait());
		}
		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());
        }