<PackageReference Include="NUnit" Version="3.14.0" />

CollectionAssert

public abstract class CollectionAssert
A set of Assert methods operating on one or more collections
protected CollectionAssert()

public static void AllItemsAreInstancesOfType(IEnumerable collection, Type expectedType)

Asserts that all items contained in collection are of the type specified by expectedType.

public static void AllItemsAreInstancesOfType(IEnumerable collection, Type expectedType, string message, object[] args)

Asserts that all items contained in collection are of the type specified by expectedType.

public static void AllItemsAreNotNull(IEnumerable collection)

Asserts that all items contained in collection are not equal to null.

public static void AllItemsAreNotNull(IEnumerable collection, string message, object[] args)

Asserts that all items contained in collection are not equal to null.

public static void AllItemsAreUnique(IEnumerable collection)

Ensures that every object contained in collection exists within the collection once and only once.

public static void AllItemsAreUnique(IEnumerable collection, string message, object[] args)

Ensures that every object contained in collection exists within the collection once and only once.

public static void AreEqual(IEnumerable expected, IEnumerable actual)

Asserts that expected and actual are exactly equal. The collections must have the same count, and contain the exact same objects in the same order.

public static void AreEqual(IEnumerable expected, IEnumerable actual, IComparer comparer)

Asserts that expected and actual are exactly equal. The collections must have the same count, and contain the exact same objects in the same order. If comparer is not null then it will be used to compare the objects.

public static void AreEqual(IEnumerable expected, IEnumerable actual, string message, object[] args)

Asserts that expected and actual are exactly equal. The collections must have the same count, and contain the exact same objects in the same order.

public static void AreEqual(IEnumerable expected, IEnumerable actual, IComparer comparer, string message, object[] args)

Asserts that expected and actual are exactly equal. The collections must have the same count, and contain the exact same objects in the same order. If comparer is not null then it will be used to compare the objects.

public static void AreEquivalent(IEnumerable expected, IEnumerable actual)

Asserts that expected and actual are equivalent, containing the same objects but the match may be in any order.

public static void AreEquivalent(IEnumerable expected, IEnumerable actual, string message, object[] args)

Asserts that expected and actual are equivalent, containing the same objects but the match may be in any order.

public static void AreNotEqual(IEnumerable expected, IEnumerable actual)

Asserts that expected and actual are not exactly equal.

public static void AreNotEqual(IEnumerable expected, IEnumerable actual, IComparer comparer)

Asserts that expected and actual are not exactly equal. If comparer is not null then it will be used to compare the objects.

public static void AreNotEqual(IEnumerable expected, IEnumerable actual, string message, object[] args)

Asserts that expected and actual are not exactly equal.

public static void AreNotEqual(IEnumerable expected, IEnumerable actual, IComparer comparer, string message, object[] args)

Asserts that expected and actual are not exactly equal. If comparer is not null then it will be used to compare the objects.

public static void AreNotEquivalent(IEnumerable expected, IEnumerable actual)

Asserts that expected and actual are not equivalent.

public static void AreNotEquivalent(IEnumerable expected, IEnumerable actual, string message, object[] args)

Asserts that expected and actual are not equivalent.

public static void Contains(IEnumerable collection, object actual)

Asserts that collection contains actual as an item.

public static void Contains(IEnumerable collection, object actual, string message, object[] args)

Asserts that collection contains actual as an item.

public static void DoesNotContain(IEnumerable collection, object actual)

Asserts that collection does not contain actual as an item.

public static void DoesNotContain(IEnumerable collection, object actual, string message, object[] args)

Asserts that collection does not contain actual as an item.

public static bool Equals(object a, object b)

DO NOT USE! Use CollectionAssert.AreEqual(...) instead. The Equals method throws an InvalidOperationException. This is done to make sure there is no mistake by calling this function.

public static void IsEmpty(IEnumerable collection, string message, object[] args)

Assert that an array, list or other collection is empty

public static void IsEmpty(IEnumerable collection)

Assert that an array,list or other collection is empty

public static void IsNotEmpty(IEnumerable collection, string message, object[] args)

Assert that an array, list or other collection is empty

public static void IsNotEmpty(IEnumerable collection)

Assert that an array,list or other collection is empty

public static void IsNotSubsetOf(IEnumerable subset, IEnumerable superset)

Asserts that the superset does not contain the subset

public static void IsNotSubsetOf(IEnumerable subset, IEnumerable superset, string message, object[] args)

Asserts that the superset does not contain the subset

public static void IsNotSupersetOf(IEnumerable superset, IEnumerable subset)

Asserts that the subset does not contain the superset

public static void IsNotSupersetOf(IEnumerable superset, IEnumerable subset, string message, object[] args)

Asserts that the subset does not contain the superset

public static void IsOrdered(IEnumerable collection, string message, object[] args)

Assert that an array, list or other collection is ordered

public static void IsOrdered(IEnumerable collection)

Assert that an array, list or other collection is ordered

public static void IsOrdered(IEnumerable collection, IComparer comparer, string message, object[] args)

Assert that an array, list or other collection is ordered

public static void IsOrdered(IEnumerable collection, IComparer comparer)

Assert that an array, list or other collection is ordered

public static void IsSubsetOf(IEnumerable subset, IEnumerable superset)

Asserts that the superset contains the subset.

public static void IsSubsetOf(IEnumerable subset, IEnumerable superset, string message, object[] args)

Asserts that the superset contains the subset.

public static void IsSupersetOf(IEnumerable superset, IEnumerable subset)

Asserts that the subset contains the superset.

public static void IsSupersetOf(IEnumerable superset, IEnumerable subset, string message, object[] args)

Asserts that the subset contains the superset.

public static void ReferenceEquals(object a, object b)

DO NOT USE! The ReferenceEquals method throws an InvalidOperationException. This is done to make sure there is no mistake by calling this function.