Guard.IsEqualTo Method

Definition

Overloads

IsEqualTo(UIntPtr, UIntPtr, String)

Asserts that the input value must be equal to a specified value.

IsEqualTo(UInt64, UInt64, String)

Asserts that the input value must be equal to a specified value.

IsEqualTo(UInt32, UInt32, String)

Asserts that the input value must be equal to a specified value.

IsEqualTo(UInt16, UInt16, String)

Asserts that the input value must be equal to a specified value.

IsEqualTo(Single, Single, String)

Asserts that the input value must be equal to a specified value.

IsEqualTo(SByte, SByte, String)

Asserts that the input value must be equal to a specified value.

IsEqualTo(IntPtr, IntPtr, String)

Asserts that the input value must be equal to a specified value.

IsEqualTo(Int64, Int64, String)

Asserts that the input value must be equal to a specified value.

IsEqualTo(Int32, Int32, String)

Asserts that the input value must be equal to a specified value.

IsEqualTo(Int16, Int16, String)

Asserts that the input value must be equal to a specified value.

IsEqualTo(Double, Double, String)

Asserts that the input value must be equal to a specified value.

IsEqualTo(Decimal, Decimal, String)

Asserts that the input value must be equal to a specified value.

IsEqualTo(Char, Char, String)

Asserts that the input value must be equal to a specified value.

IsEqualTo(Byte, Byte, String)

Asserts that the input value must be equal to a specified value.

IsEqualTo<T>(T, T, String)

Asserts that the input value must be equal to a specified value.

IsEqualTo(UIntPtr, UIntPtr, String)

Asserts that the input value must be equal to a specified value.

public static void IsEqualTo (nuint value, nuint target, string name);
static member IsEqualTo : unativeint * unativeint * string -> unit
Public Shared Sub IsEqualTo (value As UIntPtr, target As UIntPtr, name As String)

Parameters

value
UIntPtr

nuint

unativeint

The input nuint value to test.

target
UIntPtr

nuint

unativeint

The target nuint value to test for.

name
String

The name of the input parameter being tested.

Exceptions

Thrown if value is != target.

Applies to

IsEqualTo(UInt64, UInt64, String)

Asserts that the input value must be equal to a specified value.

public static void IsEqualTo (ulong value, ulong target, string name);
static member IsEqualTo : uint64 * uint64 * string -> unit
Public Shared Sub IsEqualTo (value As ULong, target As ULong, name As String)

Parameters

value
UInt64

The input UInt64 value to test.

target
UInt64

The target UInt64 value to test for.

name
String

The name of the input parameter being tested.

Exceptions

Thrown if value is != target.

Applies to

IsEqualTo(UInt32, UInt32, String)

Asserts that the input value must be equal to a specified value.

public static void IsEqualTo (uint value, uint target, string name);
static member IsEqualTo : uint32 * uint32 * string -> unit
Public Shared Sub IsEqualTo (value As UInteger, target As UInteger, name As String)

Parameters

value
UInt32

The input UInt32 value to test.

target
UInt32

The target UInt32 value to test for.

name
String

The name of the input parameter being tested.

Exceptions

Thrown if value is != target.

Applies to

IsEqualTo(UInt16, UInt16, String)

Asserts that the input value must be equal to a specified value.

public static void IsEqualTo (ushort value, ushort target, string name);
static member IsEqualTo : uint16 * uint16 * string -> unit
Public Shared Sub IsEqualTo (value As UShort, target As UShort, name As String)

Parameters

value
UInt16

The input UInt16 value to test.

target
UInt16

The target UInt16 value to test for.

name
String

The name of the input parameter being tested.

Exceptions

Thrown if value is != target.

Applies to

IsEqualTo(Single, Single, String)

Asserts that the input value must be equal to a specified value.

public static void IsEqualTo (float value, float target, string name);
static member IsEqualTo : single * single * string -> unit
Public Shared Sub IsEqualTo (value As Single, target As Single, name As String)

Parameters

value
Single

The input Single value to test.

target
Single

The target Single value to test for.

name
String

The name of the input parameter being tested.

Exceptions

Thrown if value is != target.

Applies to

IsEqualTo(SByte, SByte, String)

Asserts that the input value must be equal to a specified value.

public static void IsEqualTo (sbyte value, sbyte target, string name);
static member IsEqualTo : sbyte * sbyte * string -> unit
Public Shared Sub IsEqualTo (value As SByte, target As SByte, name As String)

Parameters

value
SByte

The input SByte value to test.

target
SByte

The target SByte value to test for.

name
String

The name of the input parameter being tested.

Exceptions

Thrown if value is != target.

Applies to

IsEqualTo(IntPtr, IntPtr, String)

Asserts that the input value must be equal to a specified value.

public static void IsEqualTo (nint value, nint target, string name);
static member IsEqualTo : nativeint * nativeint * string -> unit
Public Shared Sub IsEqualTo (value As IntPtr, target As IntPtr, name As String)

Parameters

value
IntPtr

nint

nativeint

The input nint value to test.

target
IntPtr

nint

nativeint

The target nint value to test for.

name
String

The name of the input parameter being tested.

Exceptions

Thrown if value is != target.

Applies to

IsEqualTo(Int64, Int64, String)

Asserts that the input value must be equal to a specified value.

public static void IsEqualTo (long value, long target, string name);
static member IsEqualTo : int64 * int64 * string -> unit
Public Shared Sub IsEqualTo (value As Long, target As Long, name As String)

Parameters

value
Int64

The input Int64 value to test.

target
Int64

The target Int64 value to test for.

name
String

The name of the input parameter being tested.

Exceptions

Thrown if value is != target.

Applies to

IsEqualTo(Int32, Int32, String)

Asserts that the input value must be equal to a specified value.

public static void IsEqualTo (int value, int target, string name);
static member IsEqualTo : int * int * string -> unit
Public Shared Sub IsEqualTo (value As Integer, target As Integer, name As String)

Parameters

value
Int32

The input Int32 value to test.

target
Int32

The target Int32 value to test for.

name
String

The name of the input parameter being tested.

Exceptions

Thrown if value is != target.

Applies to

IsEqualTo(Int16, Int16, String)

Asserts that the input value must be equal to a specified value.

public static void IsEqualTo (short value, short target, string name);
static member IsEqualTo : int16 * int16 * string -> unit
Public Shared Sub IsEqualTo (value As Short, target As Short, name As String)

Parameters

value
Int16

The input Int16 value to test.

target
Int16

The target Int16 value to test for.

name
String

The name of the input parameter being tested.

Exceptions

Thrown if value is != target.

Applies to

IsEqualTo(Double, Double, String)

Asserts that the input value must be equal to a specified value.

public static void IsEqualTo (double value, double target, string name);
static member IsEqualTo : double * double * string -> unit
Public Shared Sub IsEqualTo (value As Double, target As Double, name As String)

Parameters

value
Double

The input Double value to test.

target
Double

The target Double value to test for.

name
String

The name of the input parameter being tested.

Exceptions

Thrown if value is != target.

Applies to

IsEqualTo(Decimal, Decimal, String)

Asserts that the input value must be equal to a specified value.

public static void IsEqualTo (decimal value, decimal target, string name);
static member IsEqualTo : decimal * decimal * string -> unit
Public Shared Sub IsEqualTo (value As Decimal, target As Decimal, name As String)

Parameters

value
Decimal

The input Decimal value to test.

target
Decimal

The target Decimal value to test for.

name
String

The name of the input parameter being tested.

Exceptions

Thrown if value is != target.

Applies to

IsEqualTo(Char, Char, String)

Asserts that the input value must be equal to a specified value.

public static void IsEqualTo (char value, char target, string name);
static member IsEqualTo : char * char * string -> unit
Public Shared Sub IsEqualTo (value As Char, target As Char, name As String)

Parameters

value
Char

The input Char value to test.

target
Char

The target Char value to test for.

name
String

The name of the input parameter being tested.

Exceptions

Thrown if value is != target.

Applies to

IsEqualTo(Byte, Byte, String)

Asserts that the input value must be equal to a specified value.

public static void IsEqualTo (byte value, byte target, string name);
static member IsEqualTo : byte * byte * string -> unit
Public Shared Sub IsEqualTo (value As Byte, target As Byte, name As String)

Parameters

value
Byte

The input Byte value to test.

target
Byte

The target Byte value to test for.

name
String

The name of the input parameter being tested.

Exceptions

Thrown if value is != target.

Applies to

IsEqualTo<T>(T, T, String)

Asserts that the input value must be equal to a specified value.

public static void IsEqualTo<T> (T value, T target, string name) where T : IEquatable<T>;
static member IsEqualTo : 'T * 'T * string -> unit (requires 'T :> IEquatable<'T>)
Public Shared Sub IsEqualTo(Of T As IEquatable(Of T)) (value As T, target As T, name As String)

Type Parameters

T

The type of input values to compare.

Parameters

value
T

The input T value to test.

target
T

The target T value to test for.

name
String

The name of the input parameter being tested.

Exceptions

Thrown if value is != target.

Remarks

The method is generic to avoid boxing the parameters, if they are value types.

Applies to