Language

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>(Span<T>, String, String)

Tests whether all items in the specified span are non-null.

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

Tests whether all items in the specified span are non-null.

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

Tests whether all items in the specified memory are non-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<T>(Memory<T>, String, String)

Tests whether all items in the specified memory are non-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>(Span<T>, String, String)

Tests whether all items in the specified span are non-null.

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

Type Parameters

T

The type of the span items.

Parameters

collection
Span<T>

The span in which to search for null elements.

message
String

The message to include in the exception when the assertion fails.

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.

Applies to

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

Tests whether all items in the specified span are non-null.

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

Type Parameters

T

The type of the span items.

Parameters

collection
ReadOnlySpan<T>

The span in which to search for null elements.

message
String

The message to include in the exception when the assertion fails.

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.

Applies to

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

Tests whether all items in the specified memory are non-null.

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

Type Parameters

T

The type of the memory items.

Parameters

collection
ReadOnlyMemory<T>

The memory in which to search for null elements.

message
String

The message to include in the exception when the assertion fails.

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.

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

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

Tests whether all items in the specified memory are non-null.

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

Type Parameters

T

The type of the memory items.

Parameters

collection
Memory<T>

The memory in which to search for null elements.

message
String

The message to include in the exception when the assertion fails.

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.

Applies to