Assert.IsNotEmpty Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
IsNotEmpty(IEnumerable)
- Source:
- Assert.Count.cs
Tests that the collection is not empty.
public static void IsNotEmpty(System.Collections.IEnumerable collection);
static member IsNotEmpty : System.Collections.IEnumerable -> unit
Public Shared Sub IsNotEmpty (collection As IEnumerable)
Parameters
- collection
- IEnumerable
The collection.
Applies to
IsNotEmpty(IEnumerable, String)
- Source:
- Assert.Count.cs
Tests that the collection is not empty.
public static void IsNotEmpty(System.Collections.IEnumerable collection, string? message);
static member IsNotEmpty : System.Collections.IEnumerable * string -> unit
Public Shared Sub IsNotEmpty (collection As IEnumerable, message As String)
Parameters
- collection
- IEnumerable
The collection.
- message
- String
The message format to display when the assertion fails.
Applies to
IsNotEmpty(IEnumerable, String, String)
- Source:
- Assert.Count.cs
- Source:
- Assert.Count.cs
- Source:
- Assert.Count.cs
- Source:
- Assert.IsEmpty.cs
Tests that the collection is not empty.
public static void IsNotEmpty(System.Collections.IEnumerable collection, string? message = "", string collectionExpression = "");
static member IsNotEmpty : System.Collections.IEnumerable * string * string -> unit
Public Shared Sub IsNotEmpty (collection As IEnumerable, Optional message As String = "", Optional collectionExpression As String = "")
Parameters
- collection
- IEnumerable
The collection.
- message
- String
The message format to display 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
IsNotEmpty(ReadOnlyMemory, String, String)
Tests that the memory is not empty.
public static void IsNotEmpty(ReadOnlyMemory collection, string? message = "", string collectionExpression = "");
static member IsNotEmpty : ReadOnlyMemory<'T> * string * string -> unit
Public Shared Sub IsNotEmpty(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
The memory.
- message
- String
The message format to display 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
IsNotEmpty(ReadOnlySpan, Assert.AssertIsNotEmptyInterpolatedStringHandler, String)
Tests that the span is not empty.
public static void IsNotEmpty(ReadOnlySpan collection, ref Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AssertIsNotEmptyInterpolatedStringHandler message, string collectionExpression = "");
static member IsNotEmpty : ReadOnlySpan<'T> * AssertIsNotEmptyInterpolatedStringHandler * string -> unit
Public Shared Sub IsNotEmpty(Of T) (collection As ReadOnlySpan(Of T), ByRef message As Assert.AssertIsNotEmptyInterpolatedStringHandler(Of T), Optional collectionExpression As String = "")
Type Parameters
- T
The type of the span items.
Parameters
- collection
-
ReadOnlySpan
The span.
The message to display 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
IsNotEmpty(IEnumerable, String, String)
- Source:
- Assert.Count.cs
- Source:
- Assert.Count.cs
- Source:
- Assert.Count.cs
- Source:
- Assert.IsEmpty.cs
Tests that the collection is not empty.
public static void IsNotEmpty(System.Collections.Generic.IEnumerable collection, string? message = "", string collectionExpression = "");
static member IsNotEmpty : seq<'T> * string * string -> unit
Public Shared Sub IsNotEmpty(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
The collection.
- message
- String
The message format to display 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
IsNotEmpty(Span, Assert.AssertIsNotEmptyInterpolatedStringHandler, String)
Tests that the span is not empty.
public static void IsNotEmpty(Span collection, ref Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AssertIsNotEmptyInterpolatedStringHandler message, string collectionExpression = "");
static member IsNotEmpty : Span<'T> * AssertIsNotEmptyInterpolatedStringHandler * string -> unit
Public Shared Sub IsNotEmpty(Of T) (collection As Span(Of T), ByRef message As Assert.AssertIsNotEmptyInterpolatedStringHandler(Of T), Optional collectionExpression As String = "")
Type Parameters
- T
The type of the span items.
Parameters
- collection
-
Span
The span.
The message to display 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
IsNotEmpty(Span, String, String)
Tests that the span is not empty.
public static void IsNotEmpty(Span collection, string? message = "", string collectionExpression = "");
static member IsNotEmpty : Span<'T> * string * string -> unit
Public Shared Sub IsNotEmpty(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
The span.
- message
- String
The message format to display 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
IsNotEmpty(ReadOnlySpan, String, String)
Tests that the span is not empty.
public static void IsNotEmpty(ReadOnlySpan collection, string? message = "", string collectionExpression = "");
static member IsNotEmpty : ReadOnlySpan<'T> * string * string -> unit
Public Shared Sub IsNotEmpty(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
The span.
- message
- String
The message format to display 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
IsNotEmpty(ReadOnlyMemory, Assert.AssertIsNotEmptyInterpolatedStringHandler, String)
Tests that the memory is not empty.
public static void IsNotEmpty(ReadOnlyMemory collection, ref Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AssertIsNotEmptyInterpolatedStringHandler message, string collectionExpression = "");
static member IsNotEmpty : ReadOnlyMemory<'T> * AssertIsNotEmptyInterpolatedStringHandler * string -> unit
Public Shared Sub IsNotEmpty(Of T) (collection As ReadOnlyMemory(Of T), ByRef message As Assert.AssertIsNotEmptyInterpolatedStringHandler(Of T), Optional collectionExpression As String = "")
Type Parameters
- T
The type of the memory items.
Parameters
- collection
-
ReadOnlyMemory
The memory.
The message to display 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
IsNotEmpty(IEnumerable, Assert.AssertIsNotEmptyInterpolatedStringHandler, String)
- Source:
- Assert.Count.cs
- Source:
- Assert.Count.cs
- Source:
- Assert.Count.cs
- Source:
- Assert.IsEmpty.cs
Tests that the collection is not empty.
public static void IsNotEmpty(System.Collections.Generic.IEnumerable collection, ref Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AssertIsNotEmptyInterpolatedStringHandler message, string collectionExpression = "");
static member IsNotEmpty : seq<'T> * AssertIsNotEmptyInterpolatedStringHandler * string -> unit
Public Shared Sub IsNotEmpty(Of T) (collection As IEnumerable(Of T), ByRef message As Assert.AssertIsNotEmptyInterpolatedStringHandler(Of T), Optional collectionExpression As String = "")
Type Parameters
- T
The type of the collection items.
Parameters
- collection
-
IEnumerable
The collection.
The message to display 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
IsNotEmpty(Memory, Assert.AssertIsNotEmptyInterpolatedStringHandler, String)
Tests that the memory is not empty.
public static void IsNotEmpty(Memory collection, ref Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AssertIsNotEmptyInterpolatedStringHandler message, string collectionExpression = "");
static member IsNotEmpty : Memory<'T> * AssertIsNotEmptyInterpolatedStringHandler * string -> unit
Public Shared Sub IsNotEmpty(Of T) (collection As Memory(Of T), ByRef message As Assert.AssertIsNotEmptyInterpolatedStringHandler(Of T), Optional collectionExpression As String = "")
Type Parameters
- T
The type of the memory items.
Parameters
- collection
-
Memory
The memory.
The message to display 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
IsNotEmpty(IEnumerable, String, Object[])
- Source:
- Assert.Count.cs
- Source:
- Assert.Count.cs
- Source:
- Assert.Count.cs
- Source:
- Assert.Count.cs
Tests that the collection is not empty.
public static void IsNotEmpty(System.Collections.Generic.IEnumerable collection, string? message, params object?[]? parameters);
static member IsNotEmpty : seq<'T> * string * obj[] -> unit
Public Shared Sub IsNotEmpty(Of T) (collection As IEnumerable(Of T), message As String, ParamArray parameters As Object())
Type Parameters
- T
The type of the collection items.
Parameters
- collection
-
IEnumerable
The collection.
- message
- String
The message format to display when the assertion fails.
- parameters
- Object[]
The parameters to format the message.
Applies to
IsNotEmpty(IEnumerable, String)
- Source:
- Assert.Count.cs
- Source:
- Assert.Count.cs
- Source:
- Assert.Count.cs
- Source:
- Assert.Count.cs
Tests whether the collection is not empty.
public static void IsNotEmpty(System.Collections.Generic.IEnumerable collection, string? message);
static member IsNotEmpty : seq<'T> * string -> unit
Public Shared Sub IsNotEmpty(Of T) (collection As IEnumerable(Of T), message As String)
Type Parameters
- T
The type of the collection items.
Parameters
- collection
-
IEnumerable
The collection.
- message
- String
The message to display when the assertion fails.
Applies to
IsNotEmpty(IEnumerable, Assert.AssertIsNotEmptyInterpolatedStringHandler)
- Source:
- Assert.Count.cs
- Source:
- Assert.Count.cs
- Source:
- Assert.Count.cs
- Source:
- Assert.Count.cs
Tests that the collection is not empty.
public static void IsNotEmpty(System.Collections.Generic.IEnumerable collection, ref Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AssertIsNotEmptyInterpolatedStringHandler message);
static member IsNotEmpty : seq<'T> * AssertIsNotEmptyInterpolatedStringHandler -> unit
Public Shared Sub IsNotEmpty(Of T) (collection As IEnumerable(Of T), ByRef message As Assert.AssertIsNotEmptyInterpolatedStringHandler(Of T))
Type Parameters
- T
The type of the collection items.
Parameters
- collection
-
IEnumerable
The collection.
The message to display when the assertion fails.
Applies to
IsNotEmpty(IEnumerable)
- Source:
- Assert.Count.cs
- Source:
- Assert.Count.cs
- Source:
- Assert.Count.cs
- Source:
- Assert.Count.cs
Tests that the collection is not empty.
public static void IsNotEmpty(System.Collections.Generic.IEnumerable collection);
static member IsNotEmpty : seq<'T> -> unit
Public Shared Sub IsNotEmpty(Of T) (collection As IEnumerable(Of T))
Type Parameters
- T
The type of the items of the collection.
Parameters
- collection
-
IEnumerable
The collection.
Applies to
IsNotEmpty(Memory, String, String)
Tests that the memory is not empty.
public static void IsNotEmpty(Memory collection, string? message = "", string collectionExpression = "");
static member IsNotEmpty : Memory<'T> * string * string -> unit
Public Shared Sub IsNotEmpty(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
The memory.
- message
- String
The message format to display 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.