Assert.HasCount Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
HasCount<T>(Int32, IEnumerable<T>, String) |
Tests whether the collection has the expected count/length. |
HasCount<T>(Int32, IEnumerable<T>, String, Object[]) |
Tests whether the collection has the expected count/length. |
HasCount<T>(Int32, IEnumerable<T>, Assert.AssertCountInterpolatedStringHandler<T>) |
Tests whether the collection has the expected count/length. |
HasCount<T>(Int32, IEnumerable<T>) |
Tests whether the collection has the expected count/length. |
HasCount<T>(Int32, IEnumerable<T>, String)
- Source:
- Assert.Count.cs
Tests whether the collection has the expected count/length.
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)
Type Parameters
- T
The type of the collection items.
Parameters
- expected
- Int32
The expected count.
- collection
- IEnumerable<T>
The collection.
- message
- String
The message to display when the assertion fails.
Applies to
HasCount<T>(Int32, IEnumerable<T>, String, Object[])
- Source:
- Assert.Count.cs
Tests whether the collection has the expected count/length.
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())
Type Parameters
- T
The type of the collection items.
Parameters
- expected
- Int32
The expected count.
- collection
- IEnumerable<T>
The collection.
- message
- String
The message format to display when the assertion fails.
- parameters
- Object[]
The parameters to format the message.
Applies to
HasCount<T>(Int32, IEnumerable<T>, Assert.AssertCountInterpolatedStringHandler<T>)
- Source:
- Assert.Count.cs
Tests whether the collection has the expected count/length.
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))
Type Parameters
- T
The type of the collection items.
Parameters
- expected
- Int32
The expected count.
- collection
- IEnumerable<T>
The collection.
- message
- Assert.AssertCountInterpolatedStringHandler<T>
The message to display when the assertion fails.
Applies to
HasCount<T>(Int32, IEnumerable<T>)
- Source:
- Assert.Count.cs
Tests whether the collection has the expected count/length.
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))
Type Parameters
- T
The type of the collection items.
Parameters
- expected
- Int32
The expected count.
- collection
- IEnumerable<T>
The collection.
Applies to
.NET