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

TryAction_Test() private method

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

            With.TryAction(() => {
                               isCalled = true;
                               throw new InvalidOperationException("Test");
                           },
                           ex => {
                               if(ex is InvalidOperationException)
                                   exceptionRaised = true;
                           },
                           () => {
                               isCalled.Should().Be.True();
                               exceptionRaised.Should().Be.True();
                           });
        }