Sdílet prostřednictvím


CollectionAssert.AllItemsAreNotNull – metoda (ICollection, String)

Ověří, zda jsou všechny položky v kolekci určené není nullodkaz Null (Nothing v jazyce Visual Basic). Uplatnění selže, pokud je libovolný prvek nullodkaz Null (Nothing v jazyce Visual Basic). Vyhodnocení výrazu nezdaří, zobrazí se zpráva.

Obor názvů:  Microsoft.VisualStudio.TestTools.UnitTesting
Sestavení:  Microsoft.VisualStudio.QualityTools.UnitTestFramework (v Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll)

Syntaxe

'Deklarace
Public Shared Sub AllItemsAreNotNull ( _
    collection As ICollection, _
    message As String _
)
public static void AllItemsAreNotNull(
    ICollection collection,
    string message
)
public:
static void AllItemsAreNotNull(
    ICollection^ collection, 
    String^ message
)
static member AllItemsAreNotNull : 
        collection:ICollection * 
        message:string -> unit 
public static function AllItemsAreNotNull(
    collection : ICollection, 
    message : String
)

Parametry

  • collection
    Typ: System.Collections.ICollection
    Kolekce, ve kterém chcete vyhledat prvky, které jsou nullodkaz Null (Nothing v jazyce Visual Basic).
  • message
    Typ: System.String
    Zpráva zobrazí, pokud výrazu se nezdaří.Tuto zprávu lze zobrazit ve výsledcích zkoušek jednotky.

Výjimky

Výjimka Podmínka
AssertFailedException

Prvek, který nullodkaz Null (Nothing v jazyce Visual Basic) se nachází v collection.

Zabezpečení rozhraní .NET Framework

Viz také

Odkaz

CollectionAssert Třída

AllItemsAreNotNull – přetížení

Microsoft.VisualStudio.TestTools.UnitTesting – obor názvů

Další zdroje

Using the Assert Classes