Class CollectionAssertExtensions
Defines a code assertion helper for collection based scenarios.
public static class CollectionAssertExtensions
- Inheritance
-
CollectionAssertExtensions
- Inherited Members
Methods
ShouldBeEquivalentTo<TItem>(IEnumerable<TItem>, IEnumerable<TItem>)
Tests whether two collections contain the same elements and throws an exception if either collection contains an element not in the other collection.
public static void ShouldBeEquivalentTo<TItem>(this IEnumerable<TItem> expected, IEnumerable<TItem> actual)
Parameters
expectedIEnumerable<TItem>The first collection to compare. This contains the elements the test expects.
actualIEnumerable<TItem>The second collection to compare. This is the collection produced by the code under test.
Type Parameters
TItemThe type of item in the collection.
Exceptions
- AssertFailedException
Thrown if the condition of equivalency could not be met.
ShouldNotBeEquivalentTo<TItem>(IEnumerable<TItem>, IEnumerable<TItem>)
Tests whether two collections do not contain the same elements.
public static void ShouldNotBeEquivalentTo<TItem>(this IEnumerable<TItem> expected, IEnumerable<TItem> actual)
Parameters
expectedIEnumerable<TItem>The first collection to compare. This contains the elements the test expects.
actualIEnumerable<TItem>The second collection to compare. This is the collection produced by the code under test.
Type Parameters
TItemThe type of item in the collection.
Exceptions
- AssertFailedException
Thrown if the condition of equivalency could not be met.