Assert.AreAllNotNull Method

Definition

Overloads

Name Description
AreAllNotNull(IEnumerable, String, String)

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

AreAllNotNull<T>(IEnumerable<T>, String, String)

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

AreAllNotNull(IEnumerable, String, String)

Source:
Assert.AreAllNotNull.cs

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

public static void AreAllNotNull(System.Collections.IEnumerable? collection, string? message = "", string collectionExpression = "");
static member AreAllNotNull : System.Collections.IEnumerable * string * string -> unit
Public Shared Sub AreAllNotNull (collection As IEnumerable, Optional message As String = "", Optional collectionExpression As String = "")

Parameters

collection
IEnumerable

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.

collectionExpression
String

The syntactic expression of collection as given by the compiler via caller argument expression. Users shouldn't pass a value for this parameter.

Exceptions

Thrown if collection is null or contains at least one null element.

Applies to

AreAllNotNull<T>(IEnumerable<T>, String, String)

Source:
Assert.AreAllNotNull.cs

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

public static void AreAllNotNull<T>(System.Collections.Generic.IEnumerable<T>? collection, string? message = "", string collectionExpression = "");
static member AreAllNotNull : seq<'T> * string * string -> unit
Public Shared Sub AreAllNotNull(Of T) (collection As IEnumerable(Of T), Optional message As String = "", Optional collectionExpression As String = "")

Type Parameters

T

The type of the collection items.

Parameters

collection
IEnumerable<T>

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.

collectionExpression
String

The syntactic expression of collection as given by the compiler via caller argument expression. Users shouldn't pass a value for this parameter.

Exceptions

Thrown if collection is null or contains at least one null element.

Applies to