CollectionAssert.AreEquivalent Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
AreEquivalent(ICollection, ICollection) |
Tests whether two collections contain the same elements and throws an exception if either collection contains an element not in the other collection. |
AreEquivalent(ICollection, ICollection, String) |
Tests whether two collections contain the same elements and throws an exception if either collection contains an element not in the other collection. |
AreEquivalent(ICollection, ICollection, String, Object[]) |
Tests whether two collections contain the same elements and throws an exception if either collection contains an element not in the other collection. |
AreEquivalent<T>(IEnumerable<T>, IEnumerable<T>, IEqualityComparer<T>) |
Tests whether two collections contain the same elements and throws an exception if either collection contains an element not in the other collection. |
AreEquivalent<T>(IEnumerable<T>, IEnumerable<T>, IEqualityComparer<T>, String) |
Tests whether two collections contain the same elements and throws an exception if either collection contains an element not in the other collection. |
AreEquivalent<T>(IEnumerable<T>, IEnumerable<T>, IEqualityComparer<T>, String, Object[]) |
Tests whether two collections contain the same elements and throws an exception if either collection contains an element not in the other collection. |
AreEquivalent(ICollection, ICollection)
- Source:
- CollectionAssert.cs
- Source:
- CollectionAssert.cs
- Source:
- CollectionAssert.cs
- Source:
- CollectionAssert.cs
- Source:
- CollectionAssert.cs
- Source:
- CollectionAssert.cs
- Source:
- CollectionAssert.cs
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 AreEquivalent(System::Collections::ICollection ^ expected, System::Collections::ICollection ^ actual);
public static void AreEquivalent (System.Collections.ICollection expected, System.Collections.ICollection actual);
public static void AreEquivalent (System.Collections.ICollection? expected, System.Collections.ICollection? actual);
static member AreEquivalent : System.Collections.ICollection * System.Collections.ICollection -> unit
Public Shared Sub AreEquivalent (expected As ICollection, actual As ICollection)
Parameters
- expected
- ICollection
The first collection to compare. This contains the elements the test expects.
- actual
- ICollection
The second collection to compare. This is the collection produced by the code under test.
Exceptions
expected
and actual
nullabilities don't match,
or if any element was found in one of the collections but not the other.
Applies to
AreEquivalent(ICollection, ICollection, String)
- Source:
- CollectionAssert.cs
- Source:
- CollectionAssert.cs
- Source:
- CollectionAssert.cs
- Source:
- CollectionAssert.cs
- Source:
- CollectionAssert.cs
- Source:
- CollectionAssert.cs
- Source:
- CollectionAssert.cs
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 AreEquivalent(System::Collections::ICollection ^ expected, System::Collections::ICollection ^ actual, System::String ^ message);
public static void AreEquivalent (System.Collections.ICollection expected, System.Collections.ICollection actual, string message);
public static void AreEquivalent (System.Collections.ICollection? expected, System.Collections.ICollection? actual, string? message);
static member AreEquivalent : System.Collections.ICollection * System.Collections.ICollection * string -> unit
Public Shared Sub AreEquivalent (expected As ICollection, actual As ICollection, message As String)
Parameters
- expected
- ICollection
The first collection to compare. This contains the elements the test expects.
- actual
- ICollection
The second collection to compare. This is the collection produced by the code under test.
- message
- String
The message to include in the exception when an element was found in one of the collections but not the other. The message is shown in test results.
Exceptions
expected
and actual
nullabilities don't match,
or if any element was found in one of the collections but not the other.
Applies to
AreEquivalent(ICollection, ICollection, String, Object[])
- Source:
- CollectionAssert.cs
- Source:
- CollectionAssert.cs
- Source:
- CollectionAssert.cs
- Source:
- CollectionAssert.cs
- Source:
- CollectionAssert.cs
- Source:
- CollectionAssert.cs
- Source:
- CollectionAssert.cs
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 AreEquivalent(System::Collections::ICollection ^ expected, System::Collections::ICollection ^ actual, System::String ^ message, ... cli::array <System::Object ^> ^ parameters);
public static void AreEquivalent (System.Collections.ICollection expected, System.Collections.ICollection actual, string message, params object[] parameters);
public static void AreEquivalent (System.Collections.ICollection? expected, System.Collections.ICollection? actual, string? message, params object?[]? parameters);
static member AreEquivalent : System.Collections.ICollection * System.Collections.ICollection * string * obj[] -> unit
Public Shared Sub AreEquivalent (expected As ICollection, actual As ICollection, message As String, ParamArray parameters As Object())
Parameters
- expected
- ICollection
The first collection to compare. This contains the elements the test expects.
- actual
- ICollection
The second collection to compare. This is the collection produced by the code under test.
- message
- String
The message to include in the exception when an element was found in one of the collections but not the other. The message is shown in test results.
- parameters
- Object[]
An array of parameters to use when formatting message
.
Exceptions
expected
and actual
nullabilities don't match,
or if any element was found in one of the collections but not the other.
Applies to
AreEquivalent<T>(IEnumerable<T>, IEnumerable<T>, IEqualityComparer<T>)
- Source:
- CollectionAssert.cs
- Source:
- CollectionAssert.cs
- Source:
- CollectionAssert.cs
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 AreEquivalent<T> (System.Collections.Generic.IEnumerable<T?>? expected, System.Collections.Generic.IEnumerable<T?>? actual, System.Collections.Generic.IEqualityComparer<T>? comparer);
static member AreEquivalent : seq<'T> * seq<'T> * System.Collections.Generic.IEqualityComparer<'T> -> unit
Public Shared Sub AreEquivalent(Of T) (expected As IEnumerable(Of T), actual As IEnumerable(Of T), comparer As IEqualityComparer(Of T))
Type Parameters
- T
The type of values to compare.
Parameters
- expected
- IEnumerable<T>
The first collection to compare. This contains the elements the test expects.
- actual
- IEnumerable<T>
The second collection to compare. This is the collection produced by the code under test.
- comparer
- IEqualityComparer<T>
The compare implementation to use when comparing elements of the collection.
Exceptions
expected
and actual
nullabilities don't match,
or if any element was found in one of the collections but not the other.
Applies to
AreEquivalent<T>(IEnumerable<T>, IEnumerable<T>, IEqualityComparer<T>, String)
- Source:
- CollectionAssert.cs
- Source:
- CollectionAssert.cs
- Source:
- CollectionAssert.cs
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 AreEquivalent<T> (System.Collections.Generic.IEnumerable<T?>? expected, System.Collections.Generic.IEnumerable<T?>? actual, System.Collections.Generic.IEqualityComparer<T>? comparer, string? message);
static member AreEquivalent : seq<'T> * seq<'T> * System.Collections.Generic.IEqualityComparer<'T> * string -> unit
Public Shared Sub AreEquivalent(Of T) (expected As IEnumerable(Of T), actual As IEnumerable(Of T), comparer As IEqualityComparer(Of T), message As String)
Type Parameters
- T
The type of values to compare.
Parameters
- expected
- IEnumerable<T>
The first collection to compare. This contains the elements the test expects.
- actual
- IEnumerable<T>
The second collection to compare. This is the collection produced by the code under test.
- comparer
- IEqualityComparer<T>
The compare implementation to use when comparing elements of the collection.
- message
- String
The message to include in the exception when an element was found in one of the collections but not the other. The message is shown in test results.
Exceptions
expected
and actual
nullabilities don't match,
or if any element was found in one of the collections but not the other.
Applies to
AreEquivalent<T>(IEnumerable<T>, IEnumerable<T>, IEqualityComparer<T>, String, Object[])
- Source:
- CollectionAssert.cs
- Source:
- CollectionAssert.cs
- Source:
- CollectionAssert.cs
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 AreEquivalent<T> (System.Collections.Generic.IEnumerable<T?>? expected, System.Collections.Generic.IEnumerable<T?>? actual, System.Collections.Generic.IEqualityComparer<T>? comparer, string? message, params object?[]? parameters);
static member AreEquivalent : seq<'T> * seq<'T> * System.Collections.Generic.IEqualityComparer<'T> * string * obj[] -> unit
Public Shared Sub AreEquivalent(Of T) (expected As IEnumerable(Of T), actual As IEnumerable(Of T), comparer As IEqualityComparer(Of T), message As String, ParamArray parameters As Object())
Type Parameters
- T
The type of values to compare.
Parameters
- expected
- IEnumerable<T>
The first collection to compare. This contains the elements the test expects.
- actual
- IEnumerable<T>
The second collection to compare. This is the collection produced by the code under test.
- comparer
- IEqualityComparer<T>
The compare implementation to use when comparing elements of the collection.
- message
- String
The message to include in the exception when an element was found in one of the collections but not the other. The message is shown in test results.
- parameters
- Object[]
An array of parameters to use when formatting message
.
Exceptions
expected
and actual
nullabilities don't match,
or if any element was found in one of the collections but not the other.