Guard.HasSizeEqualTo 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
HasSizeEqualTo(String, Int32, String) |
Asserts that the input String instance must have a size of a specified value. |
HasSizeEqualTo(String, String, String) |
Asserts that the source String instance must have the same size of a destination String instance. |
HasSizeEqualTo<T>(Span<T>, Span<T>, String) |
Asserts that the source Span<T> instance must have the same size of a destination Span<T> instance. |
HasSizeEqualTo<T>(Span<T>, Int32, String) |
Asserts that the input Span<T> instance must have a size of a specified value. |
HasSizeEqualTo<T>(ReadOnlySpan<T>, Span<T>, String) |
Asserts that the source ReadOnlySpan<T> instance must have the same size of a destination ReadOnlySpan<T> instance. |
HasSizeEqualTo<T>(ReadOnlySpan<T>, Int32, String) |
Asserts that the input ReadOnlySpan<T> instance must have a size of a specified value. |
HasSizeEqualTo<T>(ReadOnlyMemory<T>, Memory<T>, String) |
Asserts that the source ReadOnlyMemory<T> instance must have the same size of a destination ReadOnlyMemory<T> instance. |
HasSizeEqualTo<T>(ReadOnlyMemory<T>, Int32, String) |
Asserts that the input ReadOnlyMemory<T> instance must have a size of a specified value. |
HasSizeEqualTo<T>(Memory<T>, Memory<T>, String) |
Asserts that the source Memory<T> instance must have the same size of a destination Memory<T> instance. |
HasSizeEqualTo<T>(List<T>, Int32, String) |
Asserts that the input List<T> instance must have a size of a specified value. |
HasSizeEqualTo<T>(T[], Int32, String) |
Asserts that the input array instance must have a size of a specified value. |
HasSizeEqualTo<T>(List<T>, List<T>, String) |
Asserts that the source List<T> instance must have the same size of a destination List<T> instance. |
HasSizeEqualTo<T>(IReadOnlyCollection<T>, Int32, String) |
Asserts that the input IReadOnlyCollection<T> instance must have a size of a specified value. |
HasSizeEqualTo<T>(IReadOnlyCollection<T>, ICollection<T>, String) |
Asserts that the source IReadOnlyCollection<T> instance must have the same size of a destination IReadOnlyCollection<T> instance. |
HasSizeEqualTo<T>(ICollection<T>, Int32, String) |
Asserts that the input ICollection<T> instance must have a size of a specified value. |
HasSizeEqualTo<T>(ICollection<T>, ICollection<T>, String) |
Asserts that the source ICollection<T> instance must have the same size of a destination ICollection<T> instance. |
HasSizeEqualTo<T>(Memory<T>, Int32, String) |
Asserts that the input Memory<T> instance must have a size of a specified value. |
HasSizeEqualTo<T>(T[], T[], String) |
Asserts that the source array instance must have the same size of a destination array instance. |
HasSizeEqualTo(String, Int32, String)
Asserts that the input String instance must have a size of a specified value.
public static void HasSizeEqualTo (string text, int size, string name);
static member HasSizeEqualTo : string * int * string -> unit
Public Shared Sub HasSizeEqualTo (text As String, size As Integer, name As String)
Parameters
- size
- Int32
The target size to test.
- name
- String
The name of the input parameter being tested.
Exceptions
Thrown if the size of text
is != size
.
Applies to
HasSizeEqualTo(String, String, String)
public static void HasSizeEqualTo (string source, string destination, string name);
static member HasSizeEqualTo : string * string * string -> unit
Public Shared Sub HasSizeEqualTo (source As String, destination As String, name As String)
Parameters
- name
- String
The name of the input parameter being tested.
Exceptions
Thrown if the size of source
is != the one of destination
.
Remarks
The String type is immutable, but the name of this API is kept for consistency with the other overloads.
Applies to
HasSizeEqualTo<T>(Span<T>, Span<T>, String)
public static void HasSizeEqualTo<T> (Span<T> source, Span<T> destination, string name);
static member HasSizeEqualTo : Span<'T> * Span<'T> * string -> unit
Public Shared Sub HasSizeEqualTo(Of T) (source As Span(Of T), destination As Span(Of T), name As String)
Type Parameters
- T
The item of items in the input Span<T> instance.
Parameters
- name
- String
The name of the input parameter being tested.
Exceptions
Thrown if the size of source
is != the one of destination
.
Applies to
HasSizeEqualTo<T>(Span<T>, Int32, String)
Asserts that the input Span<T> instance must have a size of a specified value.
public static void HasSizeEqualTo<T> (Span<T> span, int size, string name);
static member HasSizeEqualTo : Span<'T> * int * string -> unit
Public Shared Sub HasSizeEqualTo(Of T) (span As Span(Of T), size As Integer, name As String)
Type Parameters
- T
The item of items in the input Span<T> instance.
Parameters
- size
- Int32
The target size to test.
- name
- String
The name of the input parameter being tested.
Exceptions
Thrown if the size of span
is != size
.
Applies to
HasSizeEqualTo<T>(ReadOnlySpan<T>, Span<T>, String)
Asserts that the source ReadOnlySpan<T> instance must have the same size of a destination ReadOnlySpan<T> instance.
public static void HasSizeEqualTo<T> (ReadOnlySpan<T> source, Span<T> destination, string name);
static member HasSizeEqualTo : ReadOnlySpan<'T> * Span<'T> * string -> unit
Public Shared Sub HasSizeEqualTo(Of T) (source As ReadOnlySpan(Of T), destination As Span(Of T), name As String)
Type Parameters
- T
The item of items in the input ReadOnlySpan<T> instance.
Parameters
- source
- ReadOnlySpan<T>
The source ReadOnlySpan<T> instance to check the size for.
- destination
- Span<T>
The destination ReadOnlySpan<T> instance to check the size for.
- name
- String
The name of the input parameter being tested.
Exceptions
Thrown if the size of source
is != the one of destination
.
Applies to
HasSizeEqualTo<T>(ReadOnlySpan<T>, Int32, String)
Asserts that the input ReadOnlySpan<T> instance must have a size of a specified value.
public static void HasSizeEqualTo<T> (ReadOnlySpan<T> span, int size, string name);
static member HasSizeEqualTo : ReadOnlySpan<'T> * int * string -> unit
Public Shared Sub HasSizeEqualTo(Of T) (span As ReadOnlySpan(Of T), size As Integer, name As String)
Type Parameters
- T
The item of items in the input ReadOnlySpan<T> instance.
Parameters
- span
- ReadOnlySpan<T>
The input ReadOnlySpan<T> instance to check the size for.
- size
- Int32
The target size to test.
- name
- String
The name of the input parameter being tested.
Exceptions
Thrown if the size of span
is != size
.
Applies to
HasSizeEqualTo<T>(ReadOnlyMemory<T>, Memory<T>, String)
Asserts that the source ReadOnlyMemory<T> instance must have the same size of a destination ReadOnlyMemory<T> instance.
public static void HasSizeEqualTo<T> (ReadOnlyMemory<T> source, Memory<T> destination, string name);
static member HasSizeEqualTo : ReadOnlyMemory<'T> * Memory<'T> * string -> unit
Public Shared Sub HasSizeEqualTo(Of T) (source As ReadOnlyMemory(Of T), destination As Memory(Of T), name As String)
Type Parameters
- T
The item of items in the input ReadOnlyMemory<T> instance.
Parameters
- source
- ReadOnlyMemory<T>
The source ReadOnlyMemory<T> instance to check the size for.
- destination
- Memory<T>
The destination ReadOnlyMemory<T> instance to check the size for.
- name
- String
The name of the input parameter being tested.
Exceptions
Thrown if the size of source
is != the one of destination
.
Applies to
HasSizeEqualTo<T>(ReadOnlyMemory<T>, Int32, String)
Asserts that the input ReadOnlyMemory<T> instance must have a size of a specified value.
public static void HasSizeEqualTo<T> (ReadOnlyMemory<T> memory, int size, string name);
static member HasSizeEqualTo : ReadOnlyMemory<'T> * int * string -> unit
Public Shared Sub HasSizeEqualTo(Of T) (memory As ReadOnlyMemory(Of T), size As Integer, name As String)
Type Parameters
- T
The item of items in the input ReadOnlyMemory<T> instance.
Parameters
- memory
- ReadOnlyMemory<T>
The input ReadOnlyMemory<T> instance to check the size for.
- size
- Int32
The target size to test.
- name
- String
The name of the input parameter being tested.
Exceptions
Thrown if the size of memory
is != size
.
Applies to
HasSizeEqualTo<T>(Memory<T>, Memory<T>, String)
public static void HasSizeEqualTo<T> (Memory<T> source, Memory<T> destination, string name);
static member HasSizeEqualTo : Memory<'T> * Memory<'T> * string -> unit
Public Shared Sub HasSizeEqualTo(Of T) (source As Memory(Of T), destination As Memory(Of T), name As String)
Type Parameters
- T
The item of items in the input Memory<T> instance.
Parameters
- name
- String
The name of the input parameter being tested.
Exceptions
Thrown if the size of source
is != the one of destination
.
Applies to
HasSizeEqualTo<T>(List<T>, Int32, String)
Asserts that the input List<T> instance must have a size of a specified value.
public static void HasSizeEqualTo<T> (System.Collections.Generic.List<T> list, int size, string name);
static member HasSizeEqualTo : System.Collections.Generic.List<'T> * int * string -> unit
Public Shared Sub HasSizeEqualTo(Of T) (list As List(Of T), size As Integer, name As String)
Type Parameters
- T
The item of items in the input List<T> instance.
Parameters
- size
- Int32
The target size to test.
- name
- String
The name of the input parameter being tested.
Exceptions
Thrown if the size of list
is != size
.
Applies to
HasSizeEqualTo<T>(T[], Int32, String)
Asserts that the input array instance must have a size of a specified value.
public static void HasSizeEqualTo<T> (T[] array, int size, string name);
static member HasSizeEqualTo : 'T[] * int * string -> unit
Public Shared Sub HasSizeEqualTo(Of T) (array As T(), size As Integer, name As String)
Type Parameters
- T
The item of items in the input array instance.
Parameters
- array
- T[]
The input array instance to check the size for.
- size
- Int32
The target size to test.
- name
- String
The name of the input parameter being tested.
Exceptions
Thrown if the size of array
is != size
.
Applies to
HasSizeEqualTo<T>(List<T>, List<T>, String)
public static void HasSizeEqualTo<T> (System.Collections.Generic.List<T> source, System.Collections.Generic.List<T> destination, string name);
static member HasSizeEqualTo : System.Collections.Generic.List<'T> * System.Collections.Generic.List<'T> * string -> unit
Public Shared Sub HasSizeEqualTo(Of T) (source As List(Of T), destination As List(Of T), name As String)
Type Parameters
- T
The item of items in the input List<T> instance.
Parameters
- name
- String
The name of the input parameter being tested.
Exceptions
Thrown if the size of source
is != the one of destination
.
Applies to
HasSizeEqualTo<T>(IReadOnlyCollection<T>, Int32, String)
Asserts that the input IReadOnlyCollection<T> instance must have a size of a specified value.
public static void HasSizeEqualTo<T> (System.Collections.Generic.IReadOnlyCollection<T> collection, int size, string name);
static member HasSizeEqualTo : System.Collections.Generic.IReadOnlyCollection<'T> * int * string -> unit
Public Shared Sub HasSizeEqualTo(Of T) (collection As IReadOnlyCollection(Of T), size As Integer, name As String)
Type Parameters
- T
The item of items in the input IReadOnlyCollection<T> instance.
Parameters
- collection
- IReadOnlyCollection<T>
The input IReadOnlyCollection<T> instance to check the size for.
- size
- Int32
The target size to test.
- name
- String
The name of the input parameter being tested.
Exceptions
Thrown if the size of collection
is != size
.
Applies to
HasSizeEqualTo<T>(IReadOnlyCollection<T>, ICollection<T>, String)
Asserts that the source IReadOnlyCollection<T> instance must have the same size of a destination IReadOnlyCollection<T> instance.
public static void HasSizeEqualTo<T> (System.Collections.Generic.IReadOnlyCollection<T> source, System.Collections.Generic.ICollection<T> destination, string name);
static member HasSizeEqualTo : System.Collections.Generic.IReadOnlyCollection<'T> * System.Collections.Generic.ICollection<'T> * string -> unit
Public Shared Sub HasSizeEqualTo(Of T) (source As IReadOnlyCollection(Of T), destination As ICollection(Of T), name As String)
Type Parameters
- T
The item of items in the input IReadOnlyCollection<T> instance.
Parameters
- source
- IReadOnlyCollection<T>
The source IReadOnlyCollection<T> instance to check the size for.
- destination
- ICollection<T>
The destination IReadOnlyCollection<T> instance to check the size for.
- name
- String
The name of the input parameter being tested.
Exceptions
Thrown if the size of source
is != the one of destination
.
Applies to
HasSizeEqualTo<T>(ICollection<T>, Int32, String)
Asserts that the input ICollection<T> instance must have a size of a specified value.
public static void HasSizeEqualTo<T> (System.Collections.Generic.ICollection<T> collection, int size, string name);
static member HasSizeEqualTo : System.Collections.Generic.ICollection<'T> * int * string -> unit
Public Shared Sub HasSizeEqualTo(Of T) (collection As ICollection(Of T), size As Integer, name As String)
Type Parameters
- T
The item of items in the input ICollection<T> instance.
Parameters
- collection
- ICollection<T>
The input ICollection<T> instance to check the size for.
- size
- Int32
The target size to test.
- name
- String
The name of the input parameter being tested.
Exceptions
Thrown if the size of collection
is != size
.
Applies to
HasSizeEqualTo<T>(ICollection<T>, ICollection<T>, String)
Asserts that the source ICollection<T> instance must have the same size of a destination ICollection<T> instance.
public static void HasSizeEqualTo<T> (System.Collections.Generic.ICollection<T> source, System.Collections.Generic.ICollection<T> destination, string name);
static member HasSizeEqualTo : System.Collections.Generic.ICollection<'T> * System.Collections.Generic.ICollection<'T> * string -> unit
Public Shared Sub HasSizeEqualTo(Of T) (source As ICollection(Of T), destination As ICollection(Of T), name As String)
Type Parameters
- T
The item of items in the input ICollection<T> instance.
Parameters
- source
- ICollection<T>
The source ICollection<T> instance to check the size for.
- destination
- ICollection<T>
The destination ICollection<T> instance to check the size for.
- name
- String
The name of the input parameter being tested.
Exceptions
Thrown if the size of source
is != the one of destination
.
Applies to
HasSizeEqualTo<T>(Memory<T>, Int32, String)
Asserts that the input Memory<T> instance must have a size of a specified value.
public static void HasSizeEqualTo<T> (Memory<T> memory, int size, string name);
static member HasSizeEqualTo : Memory<'T> * int * string -> unit
Public Shared Sub HasSizeEqualTo(Of T) (memory As Memory(Of T), size As Integer, name As String)
Type Parameters
- T
The item of items in the input Memory<T> instance.
Parameters
- size
- Int32
The target size to test.
- name
- String
The name of the input parameter being tested.
Exceptions
Thrown if the size of memory
is != size
.
Applies to
HasSizeEqualTo<T>(T[], T[], String)
Asserts that the source array instance must have the same size of a destination array instance.
public static void HasSizeEqualTo<T> (T[] source, T[] destination, string name);
static member HasSizeEqualTo : 'T[] * 'T[] * string -> unit
Public Shared Sub HasSizeEqualTo(Of T) (source As T(), destination As T(), name As String)
Type Parameters
- T
The item of items in the input array instance.
Parameters
- source
- T[]
The source array instance to check the size for.
- destination
- T[]
The destination array instance to check the size for.
- name
- String
The name of the input parameter being tested.
Exceptions
Thrown if the size of source
is != the one of destination
.