public void TryActionAsync_Test() {
var isCalled = false;
var exceptionRaised = false;
With.TryActionAsync(() => {
Task.Factory.StartNew(() => { isCalled = true; }).Wait();
throw new AggregateException("AggEx", new InvalidOperationException("Test"));
},
age => age.Handle(ex => {
if(ex is InvalidOperationException)
exceptionRaised = true;
return true;
}),
() => {
Assert.IsTrue(isCalled);
Assert.IsTrue(exceptionRaised);
});
}