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()); }
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()); }
public void RetryStrategyShouldCompleteWhenFuncThrows() { RetryStrategy s = new RetryStrategy(); Assert.Throws <AggregateException>(() => s.ExecuteWithRetryAsync <int>(null, () => { throw new Exception(); }).Wait()); }
public void RetryStrategyShouldCompleteWhenFuncReturnsNullTask() { RetryStrategy s = new RetryStrategy(); Assert.Throws <AggregateException>(() => s.ExecuteWithRetryAsync <int>(null, () => null).Wait()); }