/// <summary>CollectionAssert.AreNotEqual</summary> public static void IsNot <T>(this IEnumerable <T> actual, IEnumerable <T> notExpected, Func <T, T, bool> equalityComparison, string message = "") { CollectionAssert.AreNotEqual(notExpected.ToArray(), actual.ToArray(), new ComparisonComparer <T>(equalityComparison), message); }
/// <summary>CollectionAssert.AreNotEqual</summary> public static void IsNot <T>(this IEnumerable <T> actual, IEnumerable <T> notExpected, string message = "") { CollectionAssert.AreNotEqual(notExpected.ToArray(), actual.ToArray(), message); }
/// <summary>Verifies that two specified collections are not equal, using the specified method to compare the values of elements. The assertion fails if the collections are equal. Displays a message if the assertion fails.</summary> /// <param name="notExpected">The first collection to compare. This is the collection that the unit test does not expect to match <paramref name="actual" />.</param> /// <param name="actual">The second collection to compare. This is the collection the unit test produced.</param> /// <param name="comparer">The compare implementation to use when comparing elements of the collection.</param> /// <param name="message">A message to display if the assertion fails. This message can be seen in the unit test results.</param> /// <exception cref="AssertFailedException"> /// <paramref name="notExpected" /> is equal to <paramref name="actual" />.</exception> public virtual void AreNotEqual(ICollection notExpected, ICollection actual, IComparer comparer, string message) => CollectionAssert.AreNotEqual(notExpected, actual, comparer, message, null);
/// <summary>Verifies that two specified collections are not equal, using the specified method to compare the values of elements. The assertion fails if the collections are equal. Displays a message if the assertion fails, and applies the specified formatting to it.</summary> /// <param name="notExpected">The first collection to compare. This is the collection that the unit test does not expect to match <paramref name="actual" />.</param> /// <param name="actual">The second collection to compare. This is the collection the unit test produced.</param> /// <param name="comparer">The compare implementation to use when comparing elements of the collection.</param> /// <param name="message">A message to display if the assertion fails. This message can be seen in the unit test results.</param> /// <param name="parameters">An array of parameters to use when formatting <paramref name="message" />.</param> /// <exception cref="AssertFailedException"> /// <paramref name="notExpected" /> is equal to <paramref name="actual" />.</exception> public virtual void AreNotEqual(ICollection notExpected, ICollection actual, IComparer comparer, string message, params object[] parameters) => CollectionAssert.AreNotEqual(notExpected, actual, comparer, message, parameters);
/// <summary>Verifies that two specified collections are not equal. The assertion fails if the collections are equal.</summary> /// <param name="notExpected">The first collection to compare. This is the collection that the unit test does not expect to match <paramref name="actual" />.</param> /// <param name="actual">The second collection to compare. This is the collection the unit test produced.</param> /// <exception cref="AssertFailedException"> /// <paramref name="notExpected" /> is equal to <paramref name="actual" />.</exception> public virtual void AreNotEqual(ICollection notExpected, ICollection actual) => CollectionAssert.AreNotEqual(notExpected, actual, string.Empty, null);