语言

Assert.IsNotInstanceOfType 方法

定义

重载

名称 说明
IsNotInstanceOfType(Object, Type, String, String)

测试指定的对象是否不是错误的类型的实例,如果指定的类型位于对象的继承层次结构中,则会引发异常。

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

测试指定的对象是否不是错误的类型的实例,如果指定的类型位于对象的继承层次结构中,则会引发异常。

IsNotInstanceOfType(Object, Type, Assert+AssertIsNotInstanceOfTypeInterpolatedStringHandler, String)

测试指定的对象是否不是错误的类型的实例,如果指定的类型位于对象的继承层次结构中,则会引发异常。

IsNotInstanceOfType(Object, Type, Assert+AssertIsNotInstanceOfTypeInterpolatedStringHandler)

测试指定的对象是否不是错误的类型的实例,如果指定的类型位于对象的继承层次结构中,则会引发异常。

IsNotInstanceOfType(Object, Type)

测试指定的对象是否不是错误的类型的实例,如果指定的类型位于对象的继承层次结构中,则会引发异常。

IsNotInstanceOfType(Object, Type, String)

测试指定的对象是否不是错误的类型的实例,如果指定的类型位于对象的继承层次结构中,则会引发异常。

IsNotInstanceOfType<T>(Object)

测试指定的对象是否不是错误的泛型类型的实例,如果指定的类型位于对象的继承层次结构中,则会引发异常。

IsNotInstanceOfType<T>(Object, Assert.AssertGenericIsNotInstanceOfTypeInterpolatedStringHandler<T>)

测试指定的对象是否不是错误的泛型类型的实例,如果指定的类型位于对象的继承层次结构中,则会引发异常。

IsNotInstanceOfType<T>(Object, String)

测试指定的对象是否不是错误的泛型类型的实例,如果指定的类型位于对象的继承层次结构中,则会引发异常。

IsNotInstanceOfType<T>(Object, Assert.AssertGenericIsNotInstanceOfTypeInterpolatedStringHandler<T>, String)

测试指定的对象是否不是错误的泛型类型的实例,如果指定的类型位于对象的继承层次结构中,则会引发异常。

IsNotInstanceOfType<T>(Object, String, Object[])

测试指定的对象是否不是错误的泛型类型的实例,如果指定的类型位于对象的继承层次结构中,则会引发异常。

IsNotInstanceOfType<T>(Object, String, String)

测试指定的对象是否不是错误的泛型类型的实例,如果指定的类型位于对象的继承层次结构中,则会引发异常。

IsNotInstanceOfType(Object, Type, String, String)

Source:
Assert.IsInstanceOfType.cs
Source:
Assert.IsInstanceOfType.cs
Source:
Assert.IsInstanceOfType.cs
Source:
Assert.IsInstanceOfType.cs

测试指定的对象是否不是错误的类型的实例,如果指定的类型位于对象的继承层次结构中,则会引发异常。

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 = "")

参数

value
Object

测试期望的对象不是指定类型。

wrongType
Type

不应为的类型 value 。

message
String

在异常中包含为 实例的消息。 消息显示在测试结果中。

valueExpression
String

编译器通过调用方参数表达式提供的值的语法表达式。 用户不应传递此参数的值。

例外

如果 value 不是 null 且 wrongType 位于继承层次结构中 value,则引发 。

适用于

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

测试指定的对象是否不是错误的类型的实例,如果指定的类型位于对象的继承层次结构中,则会引发异常。

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())

参数

value
Object

测试期望的对象不是指定类型。

wrongType
Type

不应为的类型 value 。

message
String

在异常中包含为 实例的消息。 消息显示在测试结果中。

parameters
Object[]

格式设置 message时要使用的参数数组。

例外

如果 value 不是 null 且 wrongType 位于继承层次结构中 value,则引发 。

适用于

IsNotInstanceOfType(Object, Type, Assert+AssertIsNotInstanceOfTypeInterpolatedStringHandler, String)

Source:
Assert.IsInstanceOfType.cs
Source:
Assert.IsInstanceOfType.cs
Source:
Assert.IsInstanceOfType.cs
Source:
Assert.IsInstanceOfType.cs

测试指定的对象是否不是错误的类型的实例,如果指定的类型位于对象的继承层次结构中,则会引发异常。

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 = "")

参数

value
Object

测试期望的对象不是指定类型。

wrongType
Type

不应为的类型 value 。

message
Assert.AssertIsNotInstanceOfTypeInterpolatedStringHandler

在异常中包含为 实例的消息。 消息显示在测试结果中。

valueExpression
String

编译器通过调用方参数表达式提供的值的语法表达式。 用户不应传递此参数的值。

适用于

IsNotInstanceOfType(Object, Type, Assert+AssertIsNotInstanceOfTypeInterpolatedStringHandler)

Source:
Assert.IsInstanceOfType.cs
Source:
Assert.IsInstanceOfType.cs
Source:
Assert.IsInstanceOfType.cs
Source:
Assert.IsInstanceOfType.cs

测试指定的对象是否不是错误的类型的实例,如果指定的类型位于对象的继承层次结构中,则会引发异常。

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)

参数

value
Object

测试期望的对象不是指定类型。

wrongType
Type

不应为的类型 value 。

message
Assert.AssertIsNotInstanceOfTypeInterpolatedStringHandler

在异常中包含为 实例的消息。 消息显示在测试结果中。

适用于

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

测试指定的对象是否不是错误的类型的实例,如果指定的类型位于对象的继承层次结构中,则会引发异常。

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)

参数

value
Object

测试期望的对象不是指定类型。

wrongType
Type

不应为的类型 value 。

例外

如果 value 不是 null 且 wrongType 位于继承层次结构中 value,则引发 。

适用于

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

测试指定的对象是否不是错误的类型的实例,如果指定的类型位于对象的继承层次结构中,则会引发异常。

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)

参数

value
Object

测试期望的对象不是指定类型。

wrongType
Type

不应为的类型 value 。

message
String

在异常中包含为 实例的消息。 消息显示在测试结果中。

例外

如果 value 不是 null 且 wrongType 位于继承层次结构中 value,则引发 。

适用于

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

测试指定的对象是否不是错误的泛型类型的实例,如果指定的类型位于对象的继承层次结构中,则会引发异常。

public static void IsNotInstanceOfType<T>(object? value);
static member IsNotInstanceOfType : obj -> unit
Public Shared Sub IsNotInstanceOfType(Of T) (value As Object)

类型参数

T

不应为的类型 value 。

参数

value
Object

适用于

IsNotInstanceOfType<T>(Object, Assert.AssertGenericIsNotInstanceOfTypeInterpolatedStringHandler<T>)

Source:
Assert.IsInstanceOfType.cs
Source:
Assert.IsInstanceOfType.cs
Source:
Assert.IsInstanceOfType.cs
Source:
Assert.IsInstanceOfType.cs

测试指定的对象是否不是错误的泛型类型的实例,如果指定的类型位于对象的继承层次结构中,则会引发异常。

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))

类型参数

T

不应为的类型 value 。

参数

value
Object

适用于

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

测试指定的对象是否不是错误的泛型类型的实例,如果指定的类型位于对象的继承层次结构中,则会引发异常。

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)

类型参数

T

不应为的类型 value 。

参数

value
Object
message
String

适用于

IsNotInstanceOfType<T>(Object, Assert.AssertGenericIsNotInstanceOfTypeInterpolatedStringHandler<T>, String)

Source:
Assert.IsInstanceOfType.cs
Source:
Assert.IsInstanceOfType.cs
Source:
Assert.IsInstanceOfType.cs
Source:
Assert.IsInstanceOfType.cs

测试指定的对象是否不是错误的泛型类型的实例,如果指定的类型位于对象的继承层次结构中,则会引发异常。

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 = "")

类型参数

T

不应为的类型 value 。

参数

value
Object
valueExpression
String

适用于

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

测试指定的对象是否不是错误的泛型类型的实例,如果指定的类型位于对象的继承层次结构中,则会引发异常。

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())

类型参数

T

不应为的类型 value 。

参数

value
Object
message
String
parameters
Object[]

适用于

IsNotInstanceOfType<T>(Object, String, String)

Source:
Assert.IsInstanceOfType.cs
Source:
Assert.IsInstanceOfType.cs
Source:
Assert.IsInstanceOfType.cs
Source:
Assert.IsInstanceOfType.cs

测试指定的对象是否不是错误的泛型类型的实例,如果指定的类型位于对象的继承层次结构中,则会引发异常。

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 = "")

类型参数

T

不应为的类型 value 。

参数

value
Object
message
String
valueExpression
String

适用于