Partilhar via


CollectionAssert.AllItemsAreUnique Method

Definition

Overloads

AllItemsAreUnique(ICollection)

Tests whether all items in the specified collection are unique or not and throws if any two elements in the collection are equal.

AllItemsAreUnique(ICollection, String)

Tests whether all items in the specified collection are unique or not and throws if any two elements in the collection are equal.

AllItemsAreUnique(ICollection, String, Object[])

Tests whether all items in the specified collection are unique or not and throws if any two elements in the collection are equal.

AllItemsAreUnique(ICollection)

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

Tests whether all items in the specified collection are unique or not and throws if any two elements in the collection are equal.

public:
 static void AllItemsAreUnique(System::Collections::ICollection ^ collection);
public static void AllItemsAreUnique (System.Collections.ICollection collection);
public static void AllItemsAreUnique (System.Collections.ICollection? collection);
static member AllItemsAreUnique : System.Collections.ICollection -> unit
Public Shared Sub AllItemsAreUnique (collection As ICollection)

Parameters

collection
ICollection

The collection in which to search for duplicate elements.

Exceptions

collection is null, or collection contains at least one duplicate element.

Applies to

AllItemsAreUnique(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 all items in the specified collection are unique or not and throws if any two elements in the collection are equal.

public:
 static void AllItemsAreUnique(System::Collections::ICollection ^ collection, System::String ^ message);
public static void AllItemsAreUnique (System.Collections.ICollection collection, string message);
public static void AllItemsAreUnique (System.Collections.ICollection? collection, string? message);
static member AllItemsAreUnique : System.Collections.ICollection * string -> unit
Public Shared Sub AllItemsAreUnique (collection As ICollection, message As String)

Parameters

collection
ICollection

The collection in which to search for duplicate elements.

message
String

The message to include in the exception when collection contains at least one duplicate element. The message is shown in test results.

Exceptions

collection is null, or collection contains at least one duplicate element.

Applies to

AllItemsAreUnique(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 all items in the specified collection are unique or not and throws if any two elements in the collection are equal.

public:
 static void AllItemsAreUnique(System::Collections::ICollection ^ collection, System::String ^ message, ... cli::array <System::Object ^> ^ parameters);
public static void AllItemsAreUnique (System.Collections.ICollection collection, string message, params object[] parameters);
public static void AllItemsAreUnique (System.Collections.ICollection? collection, string? message, params object?[]? parameters);
static member AllItemsAreUnique : System.Collections.ICollection * string * obj[] -> unit
Public Shared Sub AllItemsAreUnique (collection As ICollection, message As String, ParamArray parameters As Object())

Parameters

collection
ICollection

The collection in which to search for duplicate elements.

message
String

The message to include in the exception when collection contains at least one duplicate element. The message is shown in test results.

parameters
Object[]

An array of parameters to use when formatting message.

Exceptions

collection is null, or collection contains at least one duplicate element.

Applies to