次の方法で共有


Assert.IsNotInstanceOfType Method

Definition

Overloads

IsNotInstanceOfType(Object, Type)

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

IsNotInstanceOfType(Object, Type, String)

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

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

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

IsNotInstanceOfType(Object, Type)

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

public:
 static void IsNotInstanceOfType(System::Object ^ value, Type ^ wrongType);
public static void IsNotInstanceOfType (object value, Type wrongType);
static member IsNotInstanceOfType : obj * Type -> unit
Public Shared Sub IsNotInstanceOfType (value As Object, wrongType As Type)

Parameters

value
Object

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

wrongType
Type

The type that value should not be.

Exceptions

Thrown if value is not null and wrongType is in the inheritance hierarchy of value.

Applies to

IsNotInstanceOfType(Object, Type, String)

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

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

Parameters

value
Object

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

wrongType
Type

The type that value should not be.

message
String

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

Exceptions

Thrown if value is not null and wrongType is in the inheritance hierarchy of value.

Applies to

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

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

public:
 static void IsNotInstanceOfType(System::Object ^ value, Type ^ wrongType, System::String ^ message, ... cli::array <System::Object ^> ^ parameters);
public static void IsNotInstanceOfType (object value, Type wrongType, string message, params object[] parameters);
static member IsNotInstanceOfType : obj * Type * string * obj[] -> unit
Public Shared Sub IsNotInstanceOfType (value As Object, wrongType As Type, message As String, ParamArray parameters As Object())

Parameters

value
Object

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

wrongType
Type

The type that value should not be.

message
String

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

parameters
Object[]

An array of parameters to use when formatting message.

Exceptions

Thrown if value is not null and wrongType is in the inheritance hierarchy of value.

Applies to