Assert.IsNotInstanceOfType 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
| 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, Assert+AssertIsNotInstanceOfTypeInterpolatedStringHandler) |
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, Assert+AssertIsNotInstanceOfTypeInterpolatedStringHandler, 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, String, 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<T>(Object, Assert.AssertGenericIsNotInstanceOfTypeInterpolatedStringHandler<T>, String) |
Tests whether the specified object is not an instance of the wrong generic type and throws an exception if the specified type is in the inheritance hierarchy of the object. |
| IsNotInstanceOfType<T>(Object, String, String) |
Tests whether the specified object is not an instance of the wrong generic type and throws an exception if the specified type is in the inheritance hierarchy of the object. |
| IsNotInstanceOfType<T>(Object, String, Object[]) |
Tests whether the specified object is not an instance of the wrong generic type and throws an exception if the specified type is in the inheritance hierarchy of the object. |
| IsNotInstanceOfType<T>(Object, String) |
Tests whether the specified object is not an instance of the wrong generic type and throws an exception if the specified type is in the inheritance hierarchy of the object. |
| IsNotInstanceOfType<T>(Object, Assert.AssertGenericIsNotInstanceOfTypeInterpolatedStringHandler<T>) |
Tests whether the specified object is not an instance of the wrong generic type and throws an exception if the specified type is in the inheritance hierarchy of the object. |
| IsNotInstanceOfType<T>(Object) |
Tests whether the specified object is not an instance of the wrong generic type and throws an exception if the specified type is in the inheritance hierarchy of the object. |
IsNotInstanceOfType(Object, Type)
- Source:
- Assert.IsInstanceOfType.cs
- Source:
- Assert.IsInstanceOfType.cs
- Source:
- Assert.IsInstanceOfType.cs
- Source:
- Assert.IsInstanceOfType.cs
- Source:
- Assert.IsInstanceOfType.cs
- Source:
- Assert.IsInstanceOfType.cs
- Source:
- Assert.IsInstanceOfType.cs
- Source:
- Assert.IsInstanceOfType.cs
- Source:
- Assert.IsInstanceOfType.cs
- Source:
- Assert.IsInstanceOfType.cs
- Source:
- Assert.IsInstanceOfType.cs
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(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, Assert+AssertIsNotInstanceOfTypeInterpolatedStringHandler)
- Source:
- Assert.IsInstanceOfType.cs
- Source:
- Assert.IsInstanceOfType.cs
- Source:
- Assert.IsInstanceOfType.cs
- Source:
- Assert.IsInstanceOfType.cs
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(object? value, Type? wrongType, ref Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AssertIsNotInstanceOfTypeInterpolatedStringHandler message);
static member IsNotInstanceOfType : obj * Type * AssertIsNotInstanceOfTypeInterpolatedStringHandler -> unit
Public Shared Sub IsNotInstanceOfType (value As Object, wrongType As Type, ByRef message As Assert.AssertIsNotInstanceOfTypeInterpolatedStringHandler)
Parameters
- value
- Object
The object the test expects not to be of the specified type.
- wrongType
- Type
The type that value should not be.
The message to include in the exception when value
is an instance of wrongType. The message is shown
in test results.
Applies to
IsNotInstanceOfType(Object, Type, String)
- Source:
- Assert.IsInstanceOfType.cs
- Source:
- Assert.IsInstanceOfType.cs
- Source:
- Assert.IsInstanceOfType.cs
- Source:
- Assert.IsInstanceOfType.cs
- Source:
- Assert.IsInstanceOfType.cs
- Source:
- Assert.IsInstanceOfType.cs
- Source:
- Assert.IsInstanceOfType.cs
- Source:
- Assert.IsInstanceOfType.cs
- Source:
- Assert.IsInstanceOfType.cs
- Source:
- Assert.IsInstanceOfType.cs
- Source:
- Assert.IsInstanceOfType.cs
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(object value, Type wrongType, 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, Assert+AssertIsNotInstanceOfTypeInterpolatedStringHandler, String)
- Source:
- Assert.IsInstanceOfType.cs
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(object? value, Type? wrongType, ref Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AssertIsNotInstanceOfTypeInterpolatedStringHandler message, string valueExpression = "");
static member IsNotInstanceOfType : obj * Type * AssertIsNotInstanceOfTypeInterpolatedStringHandler * string -> unit
Public Shared Sub IsNotInstanceOfType (value As Object, wrongType As Type, ByRef message As Assert.AssertIsNotInstanceOfTypeInterpolatedStringHandler, Optional valueExpression 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.
The message to include in the exception when value
is an instance of wrongType. The message is shown
in test results.
- valueExpression
- String
The syntactic expression of value as given by the compiler via caller argument expression. Users shouldn't pass a value for this parameter.
Applies to
IsNotInstanceOfType(Object, Type, String, Object[])
- Source:
- Assert.IsInstanceOfType.cs
- Source:
- Assert.IsInstanceOfType.cs
- Source:
- Assert.IsInstanceOfType.cs
- Source:
- Assert.IsInstanceOfType.cs
- Source:
- Assert.IsInstanceOfType.cs
- Source:
- Assert.IsInstanceOfType.cs
- Source:
- Assert.IsInstanceOfType.cs
- Source:
- Assert.IsInstanceOfType.cs
- Source:
- Assert.IsInstanceOfType.cs
- Source:
- Assert.IsInstanceOfType.cs
- Source:
- Assert.IsInstanceOfType.cs
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(object value, Type wrongType, string message, params 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
IsNotInstanceOfType(Object, Type, String, String)
- Source:
- Assert.IsInstanceOfType.cs
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(object? value, Type? wrongType, string? message = "", string valueExpression = "");
static member IsNotInstanceOfType : obj * Type * string * string -> unit
Public Shared Sub IsNotInstanceOfType (value As Object, wrongType As Type, Optional message As String = "", Optional valueExpression 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.
- valueExpression
- String
The syntactic expression of value as given by the compiler via caller argument expression. Users shouldn't pass a value for this parameter.
Exceptions
Thrown if value is not null and
wrongType is in the inheritance hierarchy
of value.
Applies to
IsNotInstanceOfType<T>(Object, Assert.AssertGenericIsNotInstanceOfTypeInterpolatedStringHandler<T>, String)
- Source:
- Assert.IsInstanceOfType.cs
Tests whether the specified object is not an instance of the wrong generic type and throws an exception if the specified type is in the inheritance hierarchy of the object.
public static void IsNotInstanceOfType<T>(object? value, Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AssertGenericIsNotInstanceOfTypeInterpolatedStringHandler<T> message, string valueExpression = "");
static member IsNotInstanceOfType : obj * Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AssertGenericIsNotInstanceOfTypeInterpolatedStringHandler<'T> * string -> unit
Public Shared Sub IsNotInstanceOfType(Of T) (value As Object, message As Assert.AssertGenericIsNotInstanceOfTypeInterpolatedStringHandler(Of T), Optional valueExpression As String = "")
Type Parameters
- T
The type that value should not be.
Parameters
- value
- Object
- valueExpression
- String
Applies to
IsNotInstanceOfType<T>(Object, String, String)
- Source:
- Assert.IsInstanceOfType.cs
Tests whether the specified object is not an instance of the wrong generic type and throws an exception if the specified type is in the inheritance hierarchy of the object.
public static void IsNotInstanceOfType<T>(object? value, string? message = "", string valueExpression = "");
static member IsNotInstanceOfType : obj * string * string -> unit
Public Shared Sub IsNotInstanceOfType(Of T) (value As Object, Optional message As String = "", Optional valueExpression As String = "")
Type Parameters
- T
The type that value should not be.
Parameters
- value
- Object
- message
- String
- valueExpression
- String
Applies to
IsNotInstanceOfType<T>(Object, String, Object[])
- Source:
- Assert.IsInstanceOfType.cs
- Source:
- Assert.IsInstanceOfType.cs
- Source:
- Assert.IsInstanceOfType.cs
- Source:
- Assert.IsInstanceOfType.cs
- Source:
- Assert.IsInstanceOfType.cs
- Source:
- Assert.IsInstanceOfType.cs
- Source:
- Assert.IsInstanceOfType.cs
- Source:
- Assert.IsInstanceOfType.cs
- Source:
- Assert.IsInstanceOfType.cs
- Source:
- Assert.IsInstanceOfType.cs
- Source:
- Assert.IsInstanceOfType.cs
Tests whether the specified object is not an instance of the wrong generic type and throws an exception if the specified type is in the inheritance hierarchy of the object.
public static void IsNotInstanceOfType<T>(object? value, string? message, params object?[]? parameters);
static member IsNotInstanceOfType : obj * string * obj[] -> unit
Public Shared Sub IsNotInstanceOfType(Of T) (value As Object, message As String, ParamArray parameters As Object())
Type Parameters
- T
The type that value should not be.
Parameters
- value
- Object
- message
- String
- parameters
- Object[]
Applies to
IsNotInstanceOfType<T>(Object, String)
- Source:
- Assert.IsInstanceOfType.cs
- Source:
- Assert.IsInstanceOfType.cs
- Source:
- Assert.IsInstanceOfType.cs
- Source:
- Assert.IsInstanceOfType.cs
- Source:
- Assert.IsInstanceOfType.cs
- Source:
- Assert.IsInstanceOfType.cs
- Source:
- Assert.IsInstanceOfType.cs
- Source:
- Assert.IsInstanceOfType.cs
- Source:
- Assert.IsInstanceOfType.cs
- Source:
- Assert.IsInstanceOfType.cs
- Source:
- Assert.IsInstanceOfType.cs
Tests whether the specified object is not an instance of the wrong generic type and throws an exception if the specified type is in the inheritance hierarchy of the object.
public static void IsNotInstanceOfType<T>(object? value, string? message);
static member IsNotInstanceOfType : obj * string -> unit
Public Shared Sub IsNotInstanceOfType(Of T) (value As Object, message As String)
Type Parameters
- T
The type that value should not be.
Parameters
- value
- Object
- message
- String
Applies to
IsNotInstanceOfType<T>(Object, Assert.AssertGenericIsNotInstanceOfTypeInterpolatedStringHandler<T>)
- Source:
- Assert.IsInstanceOfType.cs
- Source:
- Assert.IsInstanceOfType.cs
- Source:
- Assert.IsInstanceOfType.cs
- Source:
- Assert.IsInstanceOfType.cs
Tests whether the specified object is not an instance of the wrong generic type and throws an exception if the specified type is in the inheritance hierarchy of the object.
public static void IsNotInstanceOfType<T>(object? value, Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AssertGenericIsNotInstanceOfTypeInterpolatedStringHandler<T> message);
static member IsNotInstanceOfType : obj * Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AssertGenericIsNotInstanceOfTypeInterpolatedStringHandler<'T> -> unit
Public Shared Sub IsNotInstanceOfType(Of T) (value As Object, message As Assert.AssertGenericIsNotInstanceOfTypeInterpolatedStringHandler(Of T))
Type Parameters
- T
The type that value should not be.
Parameters
- value
- Object
Applies to
IsNotInstanceOfType<T>(Object)
- Source:
- Assert.IsInstanceOfType.cs
- Source:
- Assert.IsInstanceOfType.cs
- Source:
- Assert.IsInstanceOfType.cs
- Source:
- Assert.IsInstanceOfType.cs
- Source:
- Assert.IsInstanceOfType.cs
- Source:
- Assert.IsInstanceOfType.cs
- Source:
- Assert.IsInstanceOfType.cs
- Source:
- Assert.IsInstanceOfType.cs
- Source:
- Assert.IsInstanceOfType.cs
- Source:
- Assert.IsInstanceOfType.cs
- Source:
- Assert.IsInstanceOfType.cs
Tests whether the specified object is not an instance of the wrong generic type and throws an exception if the specified type is in the inheritance hierarchy of the object.
public static void IsNotInstanceOfType<T>(object? value);
static member IsNotInstanceOfType : obj -> unit
Public Shared Sub IsNotInstanceOfType(Of T) (value As Object)
Type Parameters
- T
The type that value should not be.
Parameters
- value
- Object