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();
});
}