Assert.IsNotEmpty 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
重载
IsNotEmpty(IEnumerable)
- Source:
- Assert.Count.cs
测试集合是否不为空。
public static void IsNotEmpty(System.Collections.IEnumerable collection);
static member IsNotEmpty : System.Collections.IEnumerable -> unit
Public Shared Sub IsNotEmpty (collection As IEnumerable)
参数
- collection
- IEnumerable
集合。
适用于
IsNotEmpty(IEnumerable, String)
- Source:
- Assert.Count.cs
测试集合是否不为空。
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)
参数
- collection
- IEnumerable
集合。
- message
- String
断言失败时要显示的消息格式。
适用于
IsNotEmpty(IEnumerable, String, String)
- Source:
- Assert.Count.cs
- Source:
- Assert.Count.cs
- Source:
- Assert.Count.cs
- Source:
- Assert.IsEmpty.cs
测试集合是否不为空。
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 = "")
参数
- collection
- IEnumerable
集合。
- message
- String
断言失败时要显示的消息格式。
- collectionExpression
- String
编译器通过调用方参数表达式提供的集合的语法表达式。 用户不应传递此参数的值。
适用于
IsNotEmpty<T>(ReadOnlyMemory<T>, String, String)
测试内存不为空。
public static void IsNotEmpty<T>(ReadOnlyMemory<T> 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 = "")
类型参数
- T
内存项的类型。
参数
- collection
- ReadOnlyMemory<T>
内存。
- message
- String
断言失败时要显示的消息格式。
- collectionExpression
- String
编译器通过调用方参数表达式提供的集合的语法表达式。 用户不应传递此参数的值。
适用于
IsNotEmpty<T>(ReadOnlySpan<T>, Assert.AssertIsNotEmptyInterpolatedStringHandler<T>, String)
测试范围不为空。
public static void IsNotEmpty<T>(ReadOnlySpan<T> collection, ref Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AssertIsNotEmptyInterpolatedStringHandler<T> 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 = "")
类型参数
- T
范围项的类型。
参数
- collection
- ReadOnlySpan<T>
范围。
断言失败时要显示的消息。
- collectionExpression
- String
编译器通过调用方参数表达式提供的集合的语法表达式。 用户不应传递此参数的值。
适用于
IsNotEmpty<T>(IEnumerable<T>, String, String)
- Source:
- Assert.Count.cs
- Source:
- Assert.Count.cs
- Source:
- Assert.Count.cs
- Source:
- Assert.IsEmpty.cs
测试集合是否不为空。
public static void IsNotEmpty<T>(System.Collections.Generic.IEnumerable<T> 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 = "")
类型参数
- T
集合项的类型。
参数
- collection
- IEnumerable<T>
集合。
- message
- String
断言失败时要显示的消息格式。
- collectionExpression
- String
编译器通过调用方参数表达式提供的集合的语法表达式。 用户不应传递此参数的值。
适用于
IsNotEmpty<T>(Span<T>, Assert.AssertIsNotEmptyInterpolatedStringHandler<T>, String)
测试范围不为空。
public static void IsNotEmpty<T>(Span<T> collection, ref Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AssertIsNotEmptyInterpolatedStringHandler<T> 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 = "")
类型参数
- T
范围项的类型。
参数
- collection
- Span<T>
范围。
断言失败时要显示的消息。
- collectionExpression
- String
编译器通过调用方参数表达式提供的集合的语法表达式。 用户不应传递此参数的值。
适用于
IsNotEmpty<T>(Span<T>, String, String)
测试范围不为空。
public static void IsNotEmpty<T>(Span<T> 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 = "")
类型参数
- T
范围项的类型。
参数
- collection
- Span<T>
范围。
- message
- String
断言失败时要显示的消息格式。
- collectionExpression
- String
编译器通过调用方参数表达式提供的集合的语法表达式。 用户不应传递此参数的值。
适用于
IsNotEmpty<T>(ReadOnlySpan<T>, String, String)
测试范围不为空。
public static void IsNotEmpty<T>(ReadOnlySpan<T> 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 = "")
类型参数
- T
范围项的类型。
参数
- collection
- ReadOnlySpan<T>
范围。
- message
- String
断言失败时要显示的消息格式。
- collectionExpression
- String
编译器通过调用方参数表达式提供的集合的语法表达式。 用户不应传递此参数的值。
适用于
IsNotEmpty<T>(ReadOnlyMemory<T>, Assert.AssertIsNotEmptyInterpolatedStringHandler<T>, String)
测试内存不为空。
public static void IsNotEmpty<T>(ReadOnlyMemory<T> collection, ref Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AssertIsNotEmptyInterpolatedStringHandler<T> 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 = "")
类型参数
- T
内存项的类型。
参数
- collection
- ReadOnlyMemory<T>
内存。
断言失败时要显示的消息。
- collectionExpression
- String
编译器通过调用方参数表达式提供的集合的语法表达式。 用户不应传递此参数的值。
适用于
IsNotEmpty<T>(IEnumerable<T>, Assert.AssertIsNotEmptyInterpolatedStringHandler<T>, String)
- Source:
- Assert.Count.cs
- Source:
- Assert.Count.cs
- Source:
- Assert.Count.cs
- Source:
- Assert.IsEmpty.cs
测试集合是否不为空。
public static void IsNotEmpty<T>(System.Collections.Generic.IEnumerable<T> collection, ref Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AssertIsNotEmptyInterpolatedStringHandler<T> 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 = "")
类型参数
- T
集合项的类型。
参数
- collection
- IEnumerable<T>
集合。
断言失败时要显示的消息。
- collectionExpression
- String
编译器通过调用方参数表达式提供的集合的语法表达式。 用户不应传递此参数的值。
适用于
IsNotEmpty<T>(Memory<T>, Assert.AssertIsNotEmptyInterpolatedStringHandler<T>, String)
测试内存不为空。
public static void IsNotEmpty<T>(Memory<T> collection, ref Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AssertIsNotEmptyInterpolatedStringHandler<T> 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 = "")
类型参数
- T
内存项的类型。
参数
- collection
- Memory<T>
内存。
断言失败时要显示的消息。
- collectionExpression
- String
编译器通过调用方参数表达式提供的集合的语法表达式。 用户不应传递此参数的值。
适用于
IsNotEmpty<T>(IEnumerable<T>, String, Object[])
- Source:
- Assert.Count.cs
- Source:
- Assert.Count.cs
- Source:
- Assert.Count.cs
- Source:
- Assert.Count.cs
测试集合是否不为空。
public static void IsNotEmpty<T>(System.Collections.Generic.IEnumerable<T> 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())
类型参数
- T
集合项的类型。
参数
- collection
- IEnumerable<T>
集合。
- message
- String
断言失败时要显示的消息格式。
- parameters
- Object[]
设置消息格式的参数。
适用于
IsNotEmpty<T>(IEnumerable<T>, String)
- Source:
- Assert.Count.cs
- Source:
- Assert.Count.cs
- Source:
- Assert.Count.cs
- Source:
- Assert.Count.cs
测试集合是否不为空。
public static void IsNotEmpty<T>(System.Collections.Generic.IEnumerable<T> collection, string? message);
static member IsNotEmpty : seq<'T> * string -> unit
Public Shared Sub IsNotEmpty(Of T) (collection As IEnumerable(Of T), message As String)
类型参数
- T
集合项的类型。
参数
- collection
- IEnumerable<T>
集合。
- message
- String
断言失败时要显示的消息。
适用于
IsNotEmpty<T>(IEnumerable<T>, Assert.AssertIsNotEmptyInterpolatedStringHandler<T>)
- Source:
- Assert.Count.cs
- Source:
- Assert.Count.cs
- Source:
- Assert.Count.cs
- Source:
- Assert.Count.cs
测试集合是否不为空。
public static void IsNotEmpty<T>(System.Collections.Generic.IEnumerable<T> collection, ref Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AssertIsNotEmptyInterpolatedStringHandler<T> 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))
类型参数
- T
集合项的类型。
参数
- collection
- IEnumerable<T>
集合。
断言失败时要显示的消息。
适用于
IsNotEmpty<T>(IEnumerable<T>)
- Source:
- Assert.Count.cs
- Source:
- Assert.Count.cs
- Source:
- Assert.Count.cs
- Source:
- Assert.Count.cs
测试集合是否不为空。
public static void IsNotEmpty<T>(System.Collections.Generic.IEnumerable<T> collection);
static member IsNotEmpty : seq<'T> -> unit
Public Shared Sub IsNotEmpty(Of T) (collection As IEnumerable(Of T))
类型参数
- T
集合项的类型。
参数
- collection
- IEnumerable<T>
集合。
适用于
IsNotEmpty<T>(Memory<T>, String, String)
测试内存不为空。
public static void IsNotEmpty<T>(Memory<T> 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 = "")
类型参数
- T
内存项的类型。
参数
- collection
- Memory<T>
内存。
- message
- String
断言失败时要显示的消息格式。
- collectionExpression
- String
编译器通过调用方参数表达式提供的集合的语法表达式。 用户不应传递此参数的值。