Guard.HasSizeLessThan Method

Definition

Overloads

HasSizeLessThan(String, Int32, String)

Asserts that the input String instance must have a size of less than a specified value.

HasSizeLessThan<T>(ReadOnlySpan<T>, Int32, String)

Asserts that the input ReadOnlySpan<T> instance must have a size of less than a specified value.

HasSizeLessThan<T>(T[], Int32, String)

Asserts that the input array instance must have a size of less than a specified value.

HasSizeLessThan<T>(Span<T>, Int32, String)

Asserts that the input Span<T> instance must have a size of less than a specified value.

HasSizeLessThan<T>(ReadOnlyMemory<T>, Int32, String)

Asserts that the input ReadOnlyMemory<T> instance must have a size of less than a specified value.

HasSizeLessThan<T>(Memory<T>, Int32, String)

Asserts that the input Memory<T> instance must have a size of less than a specified value.

HasSizeLessThan<T>(List<T>, Int32, String)

Asserts that the input List<T> instance must have a size of less than a specified value.

HasSizeLessThan<T>(IReadOnlyCollection<T>, Int32, String)

Asserts that the input IReadOnlyCollection<T> instance must have a size of less than a specified value.

HasSizeLessThan<T>(ICollection<T>, Int32, String)

Asserts that the input ICollection<T> instance must have a size of less than a specified value.

HasSizeLessThan(String, Int32, String)

Asserts that the input String instance must have a size of less than a specified value.

public static void HasSizeLessThan (string text, int size, string name);
static member HasSizeLessThan : string * int * string -> unit
Public Shared Sub HasSizeLessThan (text As String, size As Integer, name As String)

Parameters

text
String

The input String 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 text is >= size.

Applies to

HasSizeLessThan<T>(ReadOnlySpan<T>, Int32, String)

Asserts that the input ReadOnlySpan<T> instance must have a size of less than a specified value.

public static void HasSizeLessThan<T> (ReadOnlySpan<T> span, int size, string name);
static member HasSizeLessThan : ReadOnlySpan<'T> * int * string -> unit
Public Shared Sub HasSizeLessThan(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

HasSizeLessThan<T>(T[], Int32, String)

Asserts that the input array instance must have a size of less than a specified value.

public static void HasSizeLessThan<T> (T[] array, int size, string name);
static member HasSizeLessThan : 'T[] * int * string -> unit
Public Shared Sub HasSizeLessThan(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

HasSizeLessThan<T>(Span<T>, Int32, String)

Asserts that the input Span<T> instance must have a size of less than a specified value.

public static void HasSizeLessThan<T> (Span<T> span, int size, string name);
static member HasSizeLessThan : Span<'T> * int * string -> unit
Public Shared Sub HasSizeLessThan(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

span
Span<T>

The input Span<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

HasSizeLessThan<T>(ReadOnlyMemory<T>, Int32, String)

Asserts that the input ReadOnlyMemory<T> instance must have a size of less than a specified value.

public static void HasSizeLessThan<T> (ReadOnlyMemory<T> memory, int size, string name);
static member HasSizeLessThan : ReadOnlyMemory<'T> * int * string -> unit
Public Shared Sub HasSizeLessThan(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

HasSizeLessThan<T>(Memory<T>, Int32, String)

Asserts that the input Memory<T> instance must have a size of less than a specified value.

public static void HasSizeLessThan<T> (Memory<T> memory, int size, string name);
static member HasSizeLessThan : Memory<'T> * int * string -> unit
Public Shared Sub HasSizeLessThan(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

memory
Memory<T>

The input Memory<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

HasSizeLessThan<T>(List<T>, Int32, String)

Asserts that the input List<T> instance must have a size of less than a specified value.

public static void HasSizeLessThan<T> (System.Collections.Generic.List<T> list, int size, string name);
static member HasSizeLessThan : System.Collections.Generic.List<'T> * int * string -> unit
Public Shared Sub HasSizeLessThan(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

list
List<T>

The input List<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 list is >= size.

Applies to

HasSizeLessThan<T>(IReadOnlyCollection<T>, Int32, String)

Asserts that the input IReadOnlyCollection<T> instance must have a size of less than a specified value.

public static void HasSizeLessThan<T> (System.Collections.Generic.IReadOnlyCollection<T> collection, int size, string name);
static member HasSizeLessThan : System.Collections.Generic.IReadOnlyCollection<'T> * int * string -> unit
Public Shared Sub HasSizeLessThan(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

HasSizeLessThan<T>(ICollection<T>, Int32, String)

Asserts that the input ICollection<T> instance must have a size of less than a specified value.

public static void HasSizeLessThan<T> (System.Collections.Generic.ICollection<T> collection, int size, string name);
static member HasSizeLessThan : System.Collections.Generic.ICollection<'T> * int * string -> unit
Public Shared Sub HasSizeLessThan(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