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

TryFunction_Test() private method

private TryFunction_Test ( ) : void
return void
        public void TryFunction_Test() {
            var isCalled = false;
            var exceptionRaised = false;

            var result =
                With.TryFunction<int>(() => {
                                          isCalled = true;
                                          throw new InvalidOperationException("Test");
                                      },
                                      null,
                                      ex => {
                                          if(ex is InvalidOperationException)
                                              exceptionRaised = true;
                                      },
                                      () => {
                                          isCalled.Should().Be.True();
                                          exceptionRaised.Should().Be.True();
                                      });
        }