Assert.IsNotEmpty 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
IsNotEmpty(IEnumerable)
測試集合並非空的。
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)
測試集合並非空的。
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)
測試集合並非空的。
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)
測試集合並非空的。
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)
測試集合並非空的。
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[])
測試集合並非空的。
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)
測試集合是否為空。
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>)
測試集合並非空的。
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>)
測試集合並非空的。
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
由編譯器透過呼叫者參數表達式所提供的收集語法表達式。 使用者不應該傳遞這個參數的值。