Assert.IsInstanceOfType Assert.IsInstanceOfType Assert.IsInstanceOfType Method

Definition

Overloads

IsInstanceOfType(Object, Type, String, Object[]) IsInstanceOfType(Object, Type, String, Object[]) IsInstanceOfType(Object, Type, String, Object[])

Tests whether the specified object is an instance of the expected type and throws an exception if the expected type is not in the inheritance hierarchy of the object.

IsInstanceOfType(Object, Type) IsInstanceOfType(Object, Type) IsInstanceOfType(Object, Type)

Tests whether the specified object is an instance of the expected type and throws an exception if the expected type is not in the inheritance hierarchy of the object.

IsInstanceOfType(Object, Type, String) IsInstanceOfType(Object, Type, String) IsInstanceOfType(Object, Type, String)

Tests whether the specified object is an instance of the expected type and throws an exception if the expected type is not in the inheritance hierarchy of the object.

IsInstanceOfType(Object, Type, String, Object[]) IsInstanceOfType(Object, Type, String, Object[]) IsInstanceOfType(Object, Type, String, Object[])

Tests whether the specified object is an instance of the expected type and throws an exception if the expected type is not in the inheritance hierarchy of the object.

public static void IsInstanceOfType (object value, Type expectedType, string message, params object[] parameters);
static member IsInstanceOfType : obj * Type * string * obj[] -> unit
Public Shared Sub IsInstanceOfType (value As Object, expectedType As Type, message As String, ParamArray parameters As Object())

Parameters

value
Object Object Object

The object the test expects to be of the specified type.

expectedType
Type Type Type

The expected type of value.

message
String String String

The message to include in the exception when value is not an instance of expectedType. The message is shown in test results.

parameters
Object[]

An array of parameters to use when formatting message.

Exceptions

Thrown if value is null or expectedType is not in the inheritance hierarchy of value.

IsInstanceOfType(Object, Type) IsInstanceOfType(Object, Type) IsInstanceOfType(Object, Type)

Tests whether the specified object is an instance of the expected type and throws an exception if the expected type is not in the inheritance hierarchy of the object.

public static void IsInstanceOfType (object value, Type expectedType);
static member IsInstanceOfType : obj * Type -> unit
Public Shared Sub IsInstanceOfType (value As Object, expectedType As Type)

Parameters

value
Object Object Object

The object the test expects to be of the specified type.

expectedType
Type Type Type

The expected type of value.

Exceptions

Thrown if value is null or expectedType is not in the inheritance hierarchy of value.

IsInstanceOfType(Object, Type, String) IsInstanceOfType(Object, Type, String) IsInstanceOfType(Object, Type, String)

Tests whether the specified object is an instance of the expected type and throws an exception if the expected type is not in the inheritance hierarchy of the object.

public static void IsInstanceOfType (object value, Type expectedType, string message);
static member IsInstanceOfType : obj * Type * string -> unit
Public Shared Sub IsInstanceOfType (value As Object, expectedType As Type, message As String)

Parameters

value
Object Object Object

The object the test expects to be of the specified type.

expectedType
Type Type Type

The expected type of value.

message
String String String

The message to include in the exception when value is not an instance of expectedType. The message is shown in test results.

Exceptions

Thrown if value is null or expectedType is not in the inheritance hierarchy of value.

Applies to