The following is the list of collection assertions that enable you to verify the contents of collections:
AllItemsAreInstancesOfType—Verifies that all items in a collection are, or inherit from, a specified type.
AllItemsAreNotNull—Verifies that no item in the collection is null.
AllItemsAreUnique—Verifies that a collection is a set; each item occurs only once.
AreEqual and AreNotEqual—Verifies that two collections have the same number of items, and that each item in the first collection is equal to the item at the same index in the second collection.
AreEquivalent and AreNotEquivalent—Verifies that two collections have the same number of items, and that each item in the first collection has an item that is equal to it in the second collection. This differs from AreEqual
and AreNotEqual
in that order does not matter.
Contains and DoesNotContain—Verifies that a collection contains a specified item.
IsSubsetOf and IsNotSubsetOf—Verifies that all items in one collection exist in another specified collection.
18.227.134.133