Assert.HasCount Metoda
Definice
Důležité
Některé informace platí pro předběžně vydaný produkt, který se může zásadně změnit, než ho výrobce nebo autor vydá. Microsoft neposkytuje žádné záruky, výslovné ani předpokládané, týkající se zde uváděných informací.
Přetížení
HasCount(Int32, IEnumerable, String)
- Zdroj:
- Assert.Count.cs
Testuje, jestli má kolekce očekávaný počet a délku.
public static void HasCount(int expected, System.Collections.IEnumerable collection, string? message);
static member HasCount : int * System.Collections.IEnumerable * string -> unit
Public Shared Sub HasCount (expected As Integer, collection As IEnumerable, message As String)
Parametry
- expected
- Int32
Očekávaný počet.
- collection
- IEnumerable
Kolekce
- message
- String
Formát zprávy, který se má zobrazit, když kontrolní výraz selže.
Platí pro
HasCount(Int32, IEnumerable, String, String)
- Zdroj:
- Assert.Count.cs
- Zdroj:
- Assert.Count.cs
- Zdroj:
- Assert.Count.cs
- Zdroj:
- Assert.HasCount.cs
Testuje, jestli má kolekce očekávaný počet a délku.
public static void HasCount(int expected, System.Collections.IEnumerable collection, string? message = "", string collectionExpression = "");
static member HasCount : int * System.Collections.IEnumerable * string * string -> unit
Public Shared Sub HasCount (expected As Integer, collection As IEnumerable, Optional message As String = "", Optional collectionExpression As String = "")
Parametry
- expected
- Int32
Očekávaný počet.
- collection
- IEnumerable
Kolekce
- message
- String
Zpráva, která se má zobrazit, když kontrolní výraz selže.
- collectionExpression
- String
Syntaktický výraz kolekce zadaný kompilátorem prostřednictvím výrazu argumentu volajícího. Uživatelé by neměli předávat hodnotu pro tento parametr.
Platí pro
HasCount(Int32, IEnumerable)
- Zdroj:
- Assert.Count.cs
Testuje, jestli má kolekce očekávaný počet a délku.
public static void HasCount(int expected, System.Collections.IEnumerable collection);
static member HasCount : int * System.Collections.IEnumerable -> unit
Public Shared Sub HasCount (expected As Integer, collection As IEnumerable)
Parametry
- expected
- Int32
Očekávaný počet.
- collection
- IEnumerable
Kolekce
Platí pro
HasCount<T>(Int32, Span<T>, String, String)
- Zdroj:
- Assert.HasCount.cs
Testuje, jestli má rozsah očekávaný počet a délku.
public static void HasCount<T>(int expected, Span<T> collection, string? message = "", string collectionExpression = "");
static member HasCount : int * Span<'T> * string * string -> unit
Public Shared Sub HasCount(Of T) (expected As Integer, collection As Span(Of T), Optional message As String = "", Optional collectionExpression As String = "")
Parametry typu
- T
Typ položek rozsahu.
Parametry
- expected
- Int32
Očekávaný počet.
- collection
- Span<T>
Rozpětí.
- message
- String
Zpráva, která se má zobrazit, když kontrolní výraz selže.
- collectionExpression
- String
Syntaktický výraz kolekce zadaný kompilátorem prostřednictvím výrazu argumentu volajícího. Uživatelé by neměli předávat hodnotu pro tento parametr.
Platí pro
HasCount<T>(Int32, IEnumerable<T>)
- Zdroj:
- Assert.Count.cs
- Zdroj:
- Assert.Count.cs
- Zdroj:
- Assert.Count.cs
- Zdroj:
- Assert.Count.cs
Testuje, jestli má kolekce očekávaný počet a délku.
public static void HasCount<T>(int expected, System.Collections.Generic.IEnumerable<T> collection);
static member HasCount : int * seq<'T> -> unit
Public Shared Sub HasCount(Of T) (expected As Integer, collection As IEnumerable(Of T))
Parametry typu
- T
Typ položek kolekce.
Parametry
- expected
- Int32
Očekávaný počet.
- collection
- IEnumerable<T>
Kolekce
Platí pro
HasCount<T>(Int32, IEnumerable<T>, Assert.AssertCountInterpolatedStringHandler<T>)
- Zdroj:
- Assert.Count.cs
- Zdroj:
- Assert.Count.cs
- Zdroj:
- Assert.Count.cs
- Zdroj:
- Assert.Count.cs
Testuje, jestli má kolekce očekávaný počet a délku.
public static void HasCount<T>(int expected, System.Collections.Generic.IEnumerable<T> collection, ref Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AssertCountInterpolatedStringHandler<T> message);
static member HasCount : int * seq<'T> * AssertCountInterpolatedStringHandler -> unit
Public Shared Sub HasCount(Of T) (expected As Integer, collection As IEnumerable(Of T), ByRef message As Assert.AssertCountInterpolatedStringHandler(Of T))
Parametry typu
- T
Typ položek kolekce.
Parametry
- expected
- Int32
Očekávaný počet.
- collection
- IEnumerable<T>
Kolekce
- message
- Assert.AssertCountInterpolatedStringHandler<T>
Zpráva, která se má zobrazit, když kontrolní výraz selže.
Platí pro
HasCount<T>(Int32, IEnumerable<T>, String)
- Zdroj:
- Assert.Count.cs
- Zdroj:
- Assert.Count.cs
- Zdroj:
- Assert.Count.cs
- Zdroj:
- Assert.Count.cs
Testuje, jestli má kolekce očekávaný počet a délku.
public static void HasCount<T>(int expected, System.Collections.Generic.IEnumerable<T> collection, string? message);
static member HasCount : int * seq<'T> * string -> unit
Public Shared Sub HasCount(Of T) (expected As Integer, collection As IEnumerable(Of T), message As String)
Parametry typu
- T
Typ položek kolekce.
Parametry
- expected
- Int32
Očekávaný počet.
- collection
- IEnumerable<T>
Kolekce
- message
- String
Zpráva, která se má zobrazit, když kontrolní výraz selže.
Platí pro
HasCount<T>(Int32, IEnumerable<T>, Assert.AssertCountInterpolatedStringHandler<T>, String)
- Zdroj:
- Assert.Count.cs
- Zdroj:
- Assert.Count.cs
- Zdroj:
- Assert.Count.cs
- Zdroj:
- Assert.HasCount.cs
Testuje, jestli má kolekce očekávaný počet a délku.
public static void HasCount<T>(int expected, System.Collections.Generic.IEnumerable<T> collection, ref Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AssertCountInterpolatedStringHandler<T> message, string collectionExpression = "");
static member HasCount : int * seq<'T> * AssertCountInterpolatedStringHandler * string -> unit
Public Shared Sub HasCount(Of T) (expected As Integer, collection As IEnumerable(Of T), ByRef message As Assert.AssertCountInterpolatedStringHandler(Of T), Optional collectionExpression As String = "")
Parametry typu
- T
Typ položek kolekce.
Parametry
- expected
- Int32
Očekávaný počet.
- collection
- IEnumerable<T>
Kolekce
- message
- Assert.AssertCountInterpolatedStringHandler<T>
Zpráva, která se má zobrazit, když kontrolní výraz selže.
- collectionExpression
- String
Syntaktický výraz kolekce zadaný kompilátorem prostřednictvím výrazu argumentu volajícího. Uživatelé by neměli předávat hodnotu pro tento parametr.
Platí pro
HasCount<T>(Int32, IEnumerable<T>, String, Object[])
- Zdroj:
- Assert.Count.cs
- Zdroj:
- Assert.Count.cs
- Zdroj:
- Assert.Count.cs
- Zdroj:
- Assert.Count.cs
Testuje, jestli má kolekce očekávaný počet a délku.
public static void HasCount<T>(int expected, System.Collections.Generic.IEnumerable<T> collection, string? message, params object?[]? parameters);
static member HasCount : int * seq<'T> * string * obj[] -> unit
Public Shared Sub HasCount(Of T) (expected As Integer, collection As IEnumerable(Of T), message As String, ParamArray parameters As Object())
Parametry typu
- T
Typ položek kolekce.
Parametry
- expected
- Int32
Očekávaný počet.
- collection
- IEnumerable<T>
Kolekce
- message
- String
Formát zprávy, který se má zobrazit, když kontrolní výraz selže.
- parameters
- Object[]
Parametry pro formátování zprávy.
Platí pro
HasCount<T>(Int32, IEnumerable<T>, String, String)
- Zdroj:
- Assert.Count.cs
- Zdroj:
- Assert.Count.cs
- Zdroj:
- Assert.Count.cs
- Zdroj:
- Assert.HasCount.cs
Testuje, jestli má kolekce očekávaný počet a délku.
public static void HasCount<T>(int expected, System.Collections.Generic.IEnumerable<T> collection, string? message = "", string collectionExpression = "");
static member HasCount : int * seq<'T> * string * string -> unit
Public Shared Sub HasCount(Of T) (expected As Integer, collection As IEnumerable(Of T), Optional message As String = "", Optional collectionExpression As String = "")
Parametry typu
- T
Typ položek kolekce.
Parametry
- expected
- Int32
Očekávaný počet.
- collection
- IEnumerable<T>
Kolekce
- message
- String
Zpráva, která se má zobrazit, když kontrolní výraz selže.
- collectionExpression
- String
Syntaktický výraz kolekce zadaný kompilátorem prostřednictvím výrazu argumentu volajícího. Uživatelé by neměli předávat hodnotu pro tento parametr.
Platí pro
HasCount<T>(Int32, Memory<T>, Assert.AssertCountInterpolatedStringHandler<T>, String)
- Zdroj:
- Assert.HasCount.cs
Testuje, jestli má paměť očekávaný počet a délku.
public static void HasCount<T>(int expected, Memory<T> collection, ref Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AssertCountInterpolatedStringHandler<T> message, string collectionExpression = "");
static member HasCount : int * Memory<'T> * AssertCountInterpolatedStringHandler * string -> unit
Public Shared Sub HasCount(Of T) (expected As Integer, collection As Memory(Of T), ByRef message As Assert.AssertCountInterpolatedStringHandler(Of T), Optional collectionExpression As String = "")
Parametry typu
- T
Typ položek paměti.
Parametry
- expected
- Int32
Očekávaný počet.
- collection
- Memory<T>
Paměť.
- message
- Assert.AssertCountInterpolatedStringHandler<T>
Zpráva, která se má zobrazit, když kontrolní výraz selže.
- collectionExpression
- String
Syntaktický výraz kolekce zadaný kompilátorem prostřednictvím výrazu argumentu volajícího. Uživatelé by neměli předávat hodnotu pro tento parametr.
Platí pro
HasCount<T>(Int32, Memory<T>, String, String)
- Zdroj:
- Assert.HasCount.cs
Testuje, jestli má paměť očekávaný počet a délku.
public static void HasCount<T>(int expected, Memory<T> collection, string? message = "", string collectionExpression = "");
static member HasCount : int * Memory<'T> * string * string -> unit
Public Shared Sub HasCount(Of T) (expected As Integer, collection As Memory(Of T), Optional message As String = "", Optional collectionExpression As String = "")
Parametry typu
- T
Typ položek paměti.
Parametry
- expected
- Int32
Očekávaný počet.
- collection
- Memory<T>
Paměť.
- message
- String
Zpráva, která se má zobrazit, když kontrolní výraz selže.
- collectionExpression
- String
Syntaktický výraz kolekce zadaný kompilátorem prostřednictvím výrazu argumentu volajícího. Uživatelé by neměli předávat hodnotu pro tento parametr.
Platí pro
HasCount<T>(Int32, ReadOnlyMemory<T>, Assert.AssertCountInterpolatedStringHandler<T>, String)
- Zdroj:
- Assert.HasCount.cs
Testuje, jestli má paměť očekávaný počet a délku.
public static void HasCount<T>(int expected, ReadOnlyMemory<T> collection, ref Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AssertCountInterpolatedStringHandler<T> message, string collectionExpression = "");
static member HasCount : int * ReadOnlyMemory<'T> * AssertCountInterpolatedStringHandler * string -> unit
Public Shared Sub HasCount(Of T) (expected As Integer, collection As ReadOnlyMemory(Of T), ByRef message As Assert.AssertCountInterpolatedStringHandler(Of T), Optional collectionExpression As String = "")
Parametry typu
- T
Typ položek paměti.
Parametry
- expected
- Int32
Očekávaný počet.
- collection
- ReadOnlyMemory<T>
Paměť.
- message
- Assert.AssertCountInterpolatedStringHandler<T>
Zpráva, která se má zobrazit, když kontrolní výraz selže.
- collectionExpression
- String
Syntaktický výraz kolekce zadaný kompilátorem prostřednictvím výrazu argumentu volajícího. Uživatelé by neměli předávat hodnotu pro tento parametr.
Platí pro
HasCount<T>(Int32, ReadOnlyMemory<T>, String, String)
- Zdroj:
- Assert.HasCount.cs
Testuje, jestli má paměť očekávaný počet a délku.
public static void HasCount<T>(int expected, ReadOnlyMemory<T> collection, string? message = "", string collectionExpression = "");
static member HasCount : int * ReadOnlyMemory<'T> * string * string -> unit
Public Shared Sub HasCount(Of T) (expected As Integer, collection As ReadOnlyMemory(Of T), Optional message As String = "", Optional collectionExpression As String = "")
Parametry typu
- T
Typ položek paměti.
Parametry
- expected
- Int32
Očekávaný počet.
- collection
- ReadOnlyMemory<T>
Paměť.
- message
- String
Zpráva, která se má zobrazit, když kontrolní výraz selže.
- collectionExpression
- String
Syntaktický výraz kolekce zadaný kompilátorem prostřednictvím výrazu argumentu volajícího. Uživatelé by neměli předávat hodnotu pro tento parametr.
Platí pro
HasCount<T>(Int32, ReadOnlySpan<T>, Assert.AssertCountInterpolatedStringHandler<T>, String)
- Zdroj:
- Assert.HasCount.cs
Testuje, jestli má rozsah očekávaný počet a délku.
public static void HasCount<T>(int expected, ReadOnlySpan<T> collection, ref Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AssertCountInterpolatedStringHandler<T> message, string collectionExpression = "");
static member HasCount : int * ReadOnlySpan<'T> * AssertCountInterpolatedStringHandler * string -> unit
Public Shared Sub HasCount(Of T) (expected As Integer, collection As ReadOnlySpan(Of T), ByRef message As Assert.AssertCountInterpolatedStringHandler(Of T), Optional collectionExpression As String = "")
Parametry typu
- T
Typ položek rozsahu.
Parametry
- expected
- Int32
Očekávaný počet.
- collection
- ReadOnlySpan<T>
Rozpětí.
- message
- Assert.AssertCountInterpolatedStringHandler<T>
Zpráva, která se má zobrazit, když kontrolní výraz selže.
- collectionExpression
- String
Syntaktický výraz kolekce zadaný kompilátorem prostřednictvím výrazu argumentu volajícího. Uživatelé by neměli předávat hodnotu pro tento parametr.
Platí pro
HasCount<T>(Int32, ReadOnlySpan<T>, String, String)
- Zdroj:
- Assert.HasCount.cs
Testuje, jestli má rozsah očekávaný počet a délku.
public static void HasCount<T>(int expected, ReadOnlySpan<T> collection, string? message = "", string collectionExpression = "");
static member HasCount : int * ReadOnlySpan<'T> * string * string -> unit
Public Shared Sub HasCount(Of T) (expected As Integer, collection As ReadOnlySpan(Of T), Optional message As String = "", Optional collectionExpression As String = "")
Parametry typu
- T
Typ položek rozsahu.
Parametry
- expected
- Int32
Očekávaný počet.
- collection
- ReadOnlySpan<T>
Rozpětí.
- message
- String
Zpráva, která se má zobrazit, když kontrolní výraz selže.
- collectionExpression
- String
Syntaktický výraz kolekce zadaný kompilátorem prostřednictvím výrazu argumentu volajícího. Uživatelé by neměli předávat hodnotu pro tento parametr.
Platí pro
HasCount<T>(Int32, Span<T>, Assert.AssertCountInterpolatedStringHandler<T>, String)
- Zdroj:
- Assert.HasCount.cs
Testuje, jestli má rozsah očekávaný počet a délku.
public static void HasCount<T>(int expected, Span<T> collection, ref Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AssertCountInterpolatedStringHandler<T> message, string collectionExpression = "");
static member HasCount : int * Span<'T> * AssertCountInterpolatedStringHandler * string -> unit
Public Shared Sub HasCount(Of T) (expected As Integer, collection As Span(Of T), ByRef message As Assert.AssertCountInterpolatedStringHandler(Of T), Optional collectionExpression As String = "")
Parametry typu
- T
Typ položek rozsahu.
Parametry
- expected
- Int32
Očekávaný počet.
- collection
- Span<T>
Rozpětí.
- message
- Assert.AssertCountInterpolatedStringHandler<T>
Zpráva, která se má zobrazit, když kontrolní výraz selže.
- collectionExpression
- String
Syntaktický výraz kolekce zadaný kompilátorem prostřednictvím výrazu argumentu volajícího. Uživatelé by neměli předávat hodnotu pro tento parametr.