共用方式為


CollectionAssert.AllItemsAreNotNull 方法 (ICollection)

確認指定之集合中的所有項目都不是 nullNull 參照 (即 Visual Basic 中的 Nothing)。 如果有任何項目是 nullNull 參照 (即 Visual Basic 中的 Nothing),判斷提示就會失敗。

命名空間:  Microsoft.VisualStudio.TestTools.UnitTesting
組件:  Microsoft.VisualStudio.QualityTools.UnitTestFramework (在 Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll 中)

語法

'宣告
Public Shared Sub AllItemsAreNotNull ( _
    collection As ICollection _
)
public static void AllItemsAreNotNull(
    ICollection collection
)
public:
static void AllItemsAreNotNull(
    ICollection^ collection
)
static member AllItemsAreNotNull : 
        collection:ICollection -> unit 
public static function AllItemsAreNotNull(
    collection : ICollection
)

參數

例外狀況

例外狀況 條件
AssertFailedException

nullNull 參照 (即 Visual Basic 中的 Nothing) 的項目在 collection 中。

.NET Framework 安全性

請參閱

參考

CollectionAssert 類別

AllItemsAreNotNull 多載

Microsoft.VisualStudio.TestTools.UnitTesting 命名空間

其他資源

使用 Assert 類別