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(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.
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
Thrown if an element was found in one of the collections but not the other.
Applies to
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.
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);
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
Thrown if an element was found in one of the collections but not the other.
Applies to
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.
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);
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
Thrown if an element was found in one of the collections but not the other.