public void non_throwing_action_should_return_null() { Catch.Only <InvalidOperationException>(() => { var x = 1; x++; }) .ShouldBe(null); }
public void throwing_non_matching_exception_should_throw_non_matching_exception() { Action action = () => Catch.Only <InvalidOperationException>(() => { throw new ArgumentException(); }); Should.Throw <ArgumentException>(action); }
public void throwing_matching_exception_should_return_same_exception() { Catch.Only <InvalidOperationException>(() => { throw new InvalidOperationException(); }) .ShouldBeOfType <InvalidOperationException>(); }