Compartir a través de


CollectionAssert.AllItemsAreNotNull Method

Definition

Overloads

AllItemsAreNotNull(ICollection)

Tests whether all items in the specified collection are non-null and throws an exception if any element is null.

AllItemsAreNotNull(ICollection, String)

Tests whether all items in the specified collection are non-null and throws an exception if any element is null.

AllItemsAreNotNull(ICollection, String, Object[])

Tests whether all items in the specified collection are non-null and throws an exception if any element is null.

AllItemsAreNotNull(ICollection)

Tests whether all items in the specified collection are non-null and throws an exception if any element is null.

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

Parameters

collection
ICollection

The collection in which to search for null elements.

Exceptions

Thrown if a null element is found in collection.

Applies to

AllItemsAreNotNull(ICollection, String)

Tests whether all items in the specified collection are non-null and throws an exception if any element is null.

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

Parameters

collection
ICollection

The collection in which to search for null elements.

message
String

The message to include in the exception when collection contains a null element. The message is shown in test results.

Exceptions

Thrown if a null element is found in collection.

Applies to

AllItemsAreNotNull(ICollection, String, Object[])

Tests whether all items in the specified collection are non-null and throws an exception if any element is null.

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

Parameters

collection
ICollection

The collection in which to search for null elements.

message
String

The message to include in the exception when collection contains a null element. The message is shown in test results.

parameters
Object[]

An array of parameters to use when formatting message.

Exceptions

Thrown if a null element is found in collection.

Applies to