public void IsNotNullWithParam()
 {
     Assert.Throws <ArgumentNullException>(() => ArgumentCheck.IsNotNull(null, "param"));
     Assert.DoesNotThrow(() => ArgumentCheck.IsNotNull("this is a test"), "param");
     Assert.DoesNotThrow(() => ArgumentCheck.IsNotNull(string.Empty), "param");
     Assert.DoesNotThrow(() => ArgumentCheck.IsNotNull(1), "param");
     Assert.DoesNotThrow(() => ArgumentCheck.IsNotNull(0), "param");
 }
 public void IsNotNull()
 {
     Assert.Throws <ArgumentNullException>(() => ArgumentCheck.IsNotNull(null));
     Assert.DoesNotThrow(() => ArgumentCheck.IsNotNull("this is a test"));
     Assert.DoesNotThrow(() => ArgumentCheck.IsNotNull(string.Empty));
     Assert.DoesNotThrow(() => ArgumentCheck.IsNotNull(1));
     Assert.DoesNotThrow(() => ArgumentCheck.IsNotNull(0));
 }
예제 #3
0
 public static object Activate(Type type)
 {
     ArgumentCheck.IsNotNull(type);
     return(Activator.CreateInstance(type));
 }