CollectionAssert
A set of Assert methods operationg on one or more collections
public CollectionAssert()
Asserts that all items contained in collection are of the type specified by expectedType.
public static void AllItemsAreInstancesOfType(IEnumerable collection, Type expectedType, string message)
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.
Asserts that all items contained in collection are not equal to null.
Asserts that all items contained in collection are not equal to null.
Asserts that all items contained in collection are not equal to null.
Ensures that every object contained in collection exists within the collection
once and only once.
Ensures that every object contained in collection exists within the collection
once and only once.
Ensures that every object contained in collection exists within the collection
once and only once.
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.
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.
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)
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.
Asserts that expected and actual are equivalent, containing the same objects but the match may be in any order.
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.
Asserts that expected and actual are not exactly equal.
Asserts that expected and actual are not exactly equal.
If comparer is not null then it will be used to compare the objects.
Asserts that expected and actual are not exactly equal.
public static void AreNotEqual(IEnumerable expected, IEnumerable actual, IComparer comparer, string message)
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.
Asserts that expected and actual are not equivalent.
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.
Asserts that collection contains actual as an item.
Asserts that collection contains actual as an item.
Asserts that collection contains actual as an item.
Asserts that collection does not contain actual as an item.
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.
The Equals method throws an AssertionException. This is done
to make sure there is no mistake by calling this function.
Assert that an array, list or other collection is empty
Assert that an array, list or other collection is empty
Assert that an array,list or other collection is empty
Assert that an array, list or other collection is empty
Assert that an array, list or other collection is empty
Assert that an array,list or other collection is empty
Asserts that the superset does not contain the subset
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
Assert that an array, list or other collection is ordered
Assert that an array, list or other collection is ordered
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
Assert that an array, list or other collection is ordered
Assert that an array, list or other collection is ordered
Asserts that the superset contains the subset.
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.
override the default ReferenceEquals to throw an AssertionException. This
implementation makes sure there is no mistake in calling this function
as part of Assert.