CollectionAssert.AreNotEquivalent Method

Definition

Overloads

AreNotEquivalent(ICollection, ICollection)

Tests whether two collections contain the different elements and throws an exception if the two collections contain identical elements without regard to order.

AreNotEquivalent(ICollection, ICollection, String)

Tests whether two collections contain the different elements and throws an exception if the two collections contain identical elements without regard to order.

AreNotEquivalent(ICollection, ICollection, String, Object[])

Tests whether two collections contain the different elements and throws an exception if the two collections contain identical elements without regard to order.

AreNotEquivalent<T>(IEnumerable<T>, IEnumerable<T>, IEqualityComparer<T>)

Tests whether two collections contain the different elements and throws an exception if the two collections contain identical elements without regard to order.

AreNotEquivalent<T>(IEnumerable<T>, IEnumerable<T>, IEqualityComparer<T>, String)

Tests whether two collections contain the different elements and throws an exception if the two collections contain identical elements without regard to order.

AreNotEquivalent<T>(IEnumerable<T>, IEnumerable<T>, IEqualityComparer<T>, String, Object[])

Tests whether two collections contain the different elements and throws an exception if the two collections contain identical elements without regard to order.

AreNotEquivalent(ICollection, ICollection)

Source:
CollectionAssert.cs
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 different elements and throws an exception if the two collections contain identical elements without regard to order.

public:
 static void AreNotEquivalent(System::Collections::ICollection ^ expected, System::Collections::ICollection ^ actual);

Parameters

expected
ICollection

The first collection to compare. This contains the elements the test expects to be different than the actual collection.

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 collections contain the same elements, including the same number of duplicate occurrences of each element.

Applies to

MSTest.TestFramework 3.8.0 和其他版本
产品 版本
MSTest.TestFramework 1.1.18, 1.2.1, 1.3.2, 1.4.0, 2.2.0, 2.1.2, 2.2.10, 3.0.4, 3.1.1, 3.2.2, 3.3.1, 3.4.3, 3.5.1, 3.6.4, 3.7.3, 3.8.0

AreNotEquivalent(ICollection, ICollection, String)

Source:
CollectionAssert.cs
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 different elements and throws an exception if the two collections contain identical elements without regard to order.

public:
 static void AreNotEquivalent(System::Collections::ICollection ^ expected, System::Collections::ICollection ^ actual, System::String ^ message);

Parameters

expected
ICollection

The first collection to compare. This contains the elements the test expects to be different than the actual collection.

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 actual contains the same elements as expected. The message is shown in test results.

Exceptions

expected and actual nullabilities don't match, or if collections contain the same elements, including the same number of duplicate occurrences of each element.

Applies to

MSTest.TestFramework 3.8.0 和其他版本
产品 版本
MSTest.TestFramework 1.1.18, 1.2.1, 1.3.2, 1.4.0, 2.2.0, 2.1.2, 2.2.10, 3.0.4, 3.1.1, 3.2.2, 3.3.1, 3.4.3, 3.5.1, 3.6.4, 3.7.3, 3.8.0

AreNotEquivalent(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
Source:
CollectionAssert.cs

Tests whether two collections contain the different elements and throws an exception if the two collections contain identical elements without regard to order.

public:
 static void AreNotEquivalent(System::Collections::ICollection ^ expected, System::Collections::ICollection ^ actual, System::String ^ message, ... cli::array <System::Object ^> ^ parameters);

Parameters

expected
ICollection

The first collection to compare. This contains the elements the test expects to be different than the actual collection.

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 actual contains the same elements as expected. 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 collections contain the same elements, including the same number of duplicate occurrences of each element.

Applies to

MSTest.TestFramework 3.8.0 和其他版本
产品 版本
MSTest.TestFramework 1.1.18, 1.2.1, 1.3.2, 1.4.0, 2.2.0, 2.1.2, 2.2.10, 3.0.4, 3.1.1, 3.2.2, 3.3.1, 3.4.3, 3.5.1, 3.6.4, 3.7.3, 3.8.0

AreNotEquivalent<T>(IEnumerable<T>, IEnumerable<T>, IEqualityComparer<T>)

Source:
CollectionAssert.cs
Source:
CollectionAssert.cs
Source:
CollectionAssert.cs
Source:
CollectionAssert.cs

Tests whether two collections contain the different elements and throws an exception if the two collections contain identical elements without regard to order.

public static void AreNotEquivalent<T>(System.Collections.Generic.IEnumerable<T?>? expected, System.Collections.Generic.IEnumerable<T?>? actual, System.Collections.Generic.IEqualityComparer<T>? comparer);

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 to be different than the actual collection.

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 collections contain the same elements, including the same number of duplicate occurrences of each element.

Applies to

MSTest.TestFramework 3.8.0 和其他版本
产品 版本
MSTest.TestFramework 3.5.1, 3.6.4, 3.7.3, 3.8.0

AreNotEquivalent<T>(IEnumerable<T>, IEnumerable<T>, IEqualityComparer<T>, String)

Source:
CollectionAssert.cs
Source:
CollectionAssert.cs
Source:
CollectionAssert.cs
Source:
CollectionAssert.cs

Tests whether two collections contain the different elements and throws an exception if the two collections contain identical elements without regard to order.

public static void AreNotEquivalent<T>(System.Collections.Generic.IEnumerable<T?>? expected, System.Collections.Generic.IEnumerable<T?>? actual, System.Collections.Generic.IEqualityComparer<T>? comparer, string? message);

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 to be different than the actual collection.

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 actual contains the same elements as expected. The message is shown in test results.

Exceptions

expected and actual nullabilities don't match, or if collections contain the same elements, including the same number of duplicate occurrences of each element.

Applies to

MSTest.TestFramework 3.8.0 和其他版本
产品 版本
MSTest.TestFramework 3.5.1, 3.6.4, 3.7.3, 3.8.0

AreNotEquivalent<T>(IEnumerable<T>, IEnumerable<T>, IEqualityComparer<T>, String, Object[])

Source:
CollectionAssert.cs
Source:
CollectionAssert.cs
Source:
CollectionAssert.cs
Source:
CollectionAssert.cs

Tests whether two collections contain the different elements and throws an exception if the two collections contain identical elements without regard to order.

public static void AreNotEquivalent<T>(System.Collections.Generic.IEnumerable<T?>? expected, System.Collections.Generic.IEnumerable<T?>? actual, System.Collections.Generic.IEqualityComparer<T>? comparer, string? message, params object?[]? parameters);

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 to be different than the actual collection.

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 actual contains the same elements as expected. 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 collections contain the same elements, including the same number of duplicate occurrences of each element.

Applies to

MSTest.TestFramework 3.8.0 和其他版本
产品 版本
MSTest.TestFramework 3.5.1, 3.6.4, 3.7.3, 3.8.0