Ejemplo n.º 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());
		}
Ejemplo n.º 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());
        }
Ejemplo n.º 3
0
		public void RetryStrategyShouldCompleteWhenFuncThrows()
		{
			RetryStrategy s = new RetryStrategy();

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

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

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

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