Ejemplo n.º 1
0
 public static void IndexIsInRange(System.Collections.IList list, int index, string message)
 {
     if (!list.IndexIsInRange(index))
     {
         Fail(AssertionMessageUtil.IndexOutOfRangeMessage(index, list.Count), message);
     }
 }
Ejemplo n.º 2
0
 public static void IsNull(object value, string message)
 {
     if (value != null)
     {
         Fail(AssertionMessageUtil.NullFailureMessage(value, expectNull: true), message);
     }
 }
Ejemplo n.º 3
0
 public static void IsNotNull(Object value, string message)
 {
     if (value == null)
     {
         Fail(AssertionMessageUtil.NullFailureMessage(value, expectNull: false), message);
     }
 }
Ejemplo n.º 4
0
 public static void IsNot(bool actual, bool expected, string because)
 {
     if (actual == expected)
     {
         Fail(AssertionMessageUtil.BooleanFailureMessage(expected), because);
     }
 }
Ejemplo n.º 5
0
 public static void IsFalse(bool condition, string message)
 {
     if (condition)
     {
         Fail(AssertionMessageUtil.BooleanFailureMessage(expected: false), message);
     }
 }
Ejemplo n.º 6
0
 public static void AreNotEqual(Object expected, Object actual, string message)
 {
     if (actual == expected)
     {
         Fail(AssertionMessageUtil.GetEqualityMessage(
                  actual, expected, expectEqual: false), message);
     }
 }
Ejemplo n.º 7
0
 public static void IsNotNull <T>(T value, string message) where T : class
 {
     if (typeof(Object).IsAssignableFrom(typeof(T)))
     {
         IsNotNull(value as Object, message);
     }
     else if (value == null)
     {
         Fail(AssertionMessageUtil.NullFailureMessage(value, expectNull: false), message);
     }
 }
Ejemplo n.º 8
0
 public static void AreNotEqual <T>(T expected, T actual,
                                    string message, IEqualityComparer <T> comparer)
 {
     if (typeof(Object).IsAssignableFrom(typeof(T)))
     {
         AreNotEqual(expected as Object, actual as Object, message);
     }
     else if (comparer.Equals(actual, expected))
     {
         Fail(AssertionMessageUtil.GetEqualityMessage(actual,
                                                      expected, expectEqual: false), message);
     }
 }