예제 #1
0
 public void When_method_with_nullable_null_is_called_then_exception_is_thrown()
 {
     try
     {
         CodeContractExtensionsTestClass.Foo(new object(), "Test", null);
     }
     catch (ArgumentNullException exception)
     {
         Assert.AreEqual("c", exception.ParamName);
         return;
     }
     Assert.Fail("ArgumentNullException not thrown. ");
 }
예제 #2
0
 public void When_method_with_empty_string_is_called_then_exception_is_thrown()
 {
     try
     {
         CodeContractExtensionsTestClass.Foo(new object(), string.Empty, 1);
     }
     catch (ArgumentNullException exception)
     {
         Assert.AreEqual("b", exception.ParamName);
         return;
     }
     Assert.Fail("ArgumentNullException not thrown. ");
 }