Class CollectionAssertExtensions
Defines a code assertion helper for collection based scenarios.
Inheritance
Namespace: MADE.Testing
Assembly: MADE.Testing.dll
Syntax
public static class CollectionAssertExtensions : object
Methods
| Improve this Doc View SourceShouldBeEquivalentTo<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.
Declaration
public static void ShouldBeEquivalentTo<TItem>(this IEnumerable<TItem> expected, IEnumerable<TItem> actual)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<TItem> | expected | The first collection to compare. This contains the elements the test expects. |
IEnumerable<TItem> | actual | The second collection to compare. This is the collection produced by the code under test. |
Type Parameters
Name | Description |
---|---|
TItem | The type of item in the collection. |
Exceptions
Type | Condition |
---|---|
MADE.Testing.CollectionAssertExtensions.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.
Declaration
public static void ShouldNotBeEquivalentTo<TItem>(this IEnumerable<TItem> expected, IEnumerable<TItem> actual)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<TItem> | expected | The first collection to compare. This contains the elements the test expects. |
IEnumerable<TItem> | actual | The second collection to compare. This is the collection produced by the code under test. |
Type Parameters
Name | Description |
---|---|
TItem | The type of item in the collection. |
Exceptions
Type | Condition |
---|---|
MADE.Testing.CollectionAssertExtensions.AssertFailedException | Thrown if the condition of equivalency could not be met. |