NSoft.NFramework.WithTryActionFixture.TryActionAsync_Test C# (CSharp) Method

TryActionAsync_Test() private method

private TryActionAsync_Test ( ) : void
return void
        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);
                                });
        }