예제 #1
0
 public void non_throwing_action_should_return_null()
 {
     Catch.Only <InvalidOperationException>(() =>
     {
         var x = 1;
         x++;
     })
     .ShouldBe(null);
 }
예제 #2
0
            public void throwing_non_matching_exception_should_throw_non_matching_exception()
            {
                Action action = () => Catch.Only <InvalidOperationException>(() => { throw new ArgumentException(); });

                Should.Throw <ArgumentException>(action);
            }
예제 #3
0
 public void throwing_matching_exception_should_return_same_exception()
 {
     Catch.Only <InvalidOperationException>(() => { throw new InvalidOperationException(); })
     .ShouldBeOfType <InvalidOperationException>();
 }