Sdílet prostřednictvím


Assert.IsInstanceOfType Metoda

Definice

Přetížení

Name Description
IsInstanceOfType(Object, Type, String, String)

Testuje, zda zadaný objekt je instance očekávaného typu a vyvolá výjimku, pokud očekávaný typ není v hierarchii dědičnosti objektu.

IsInstanceOfType(Object, Type, Assert+AssertIsInstanceOfTypeInterpolatedStringHandler, String)

Testuje, zda zadaný objekt je instance očekávaného typu a vyvolá výjimku, pokud očekávaný typ není v hierarchii dědičnosti objektu.

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

Testuje, zda zadaný objekt je instance očekávaného typu a vyvolá výjimku, pokud očekávaný typ není v hierarchii dědičnosti objektu.

IsInstanceOfType(Object, Type, Assert+AssertIsInstanceOfTypeInterpolatedStringHandler)

Testuje, zda zadaný objekt je instance očekávaného typu a vyvolá výjimku, pokud očekávaný typ není v hierarchii dědičnosti objektu.

IsInstanceOfType(Object, Type, String)

Testuje, zda zadaný objekt je instance očekávaného typu a vyvolá výjimku, pokud očekávaný typ není v hierarchii dědičnosti objektu.

IsInstanceOfType(Object, Type)

Testuje, zda zadaný objekt je instance očekávaného typu a vyvolá výjimku, pokud očekávaný typ není v hierarchii dědičnosti objektu.

IsInstanceOfType<T>(Object, T, String)

Testuje, zda zadaný objekt je instance obecného typu a vyvolá výjimku, pokud obecný typ není v hierarchii dědičnosti objektu.

IsInstanceOfType<T>(Object, T, Assert.AssertGenericIsInstanceOfTypeInterpolatedStringHandler<T>)

Testuje, zda zadaný objekt je instance obecného typu a vyvolá výjimku, pokud obecný typ není v hierarchii dědičnosti objektu.

IsInstanceOfType<T>(Object, String, String)

Testuje, zda zadaný objekt je instance obecného typu a vyvolá výjimku, pokud obecný typ není v hierarchii dědičnosti objektu.

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

Testuje, zda zadaný objekt je instance obecného typu a vyvolá výjimku, pokud obecný typ není v hierarchii dědičnosti objektu.

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

Testuje, zda zadaný objekt je instance obecného typu a vyvolá výjimku, pokud obecný typ není v hierarchii dědičnosti objektu.

IsInstanceOfType<T>(Object, T)

Testuje, zda zadaný objekt je instance obecného typu a vyvolá výjimku, pokud obecný typ není v hierarchii dědičnosti objektu.

IsInstanceOfType<T>(Object, String)

Testuje, zda zadaný objekt je instance obecného typu a vyvolá výjimku, pokud obecný typ není v hierarchii dědičnosti objektu.

IsInstanceOfType<T>(Object, Assert.AssertGenericIsInstanceOfTypeInterpolatedStringHandler<T>)

Testuje, zda zadaný objekt je instance obecného typu a vyvolá výjimku, pokud obecný typ není v hierarchii dědičnosti objektu.

IsInstanceOfType<T>(Object)

Testuje, zda zadaný objekt je instance obecného typu a vyvolá výjimku, pokud obecný typ není v hierarchii dědičnosti objektu.

IsInstanceOfType<T>(Object, Assert.AssertGenericIsInstanceOfTypeInterpolatedStringHandler<T>, String)

Testuje, zda zadaný objekt je instance obecného typu a vyvolá výjimku, pokud obecný typ není v hierarchii dědičnosti objektu.

IsInstanceOfType(Object, Type, String, String)

Zdroj:
Assert.IsInstanceOfType.cs
Zdroj:
Assert.IsInstanceOfType.cs

Testuje, zda zadaný objekt je instance očekávaného typu a vyvolá výjimku, pokud očekávaný typ není v hierarchii dědičnosti objektu.

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

Parametry

value
Object

Objekt, který test očekává, bude mít zadaný typ.

expectedType
Type

Očekávaný typ .value

message
String

Zpráva, která se má zahrnout do výjimky, pokud value není instance expectedType. Zpráva se zobrazí ve výsledcích testu.

valueExpression
String

Syntaktický výraz hodnoty zadaný kompilátorem prostřednictvím výrazu argumentu volajícího. Uživatelé by neměli předávat hodnotu pro tento parametr.

Výjimky

Vyvolá se, pokud value je null nebo expectedType není v hierarchii dědičnosti value.

Platí pro

IsInstanceOfType(Object, Type, Assert+AssertIsInstanceOfTypeInterpolatedStringHandler, String)

Zdroj:
Assert.IsInstanceOfType.cs
Zdroj:
Assert.IsInstanceOfType.cs

Testuje, zda zadaný objekt je instance očekávaného typu a vyvolá výjimku, pokud očekávaný typ není v hierarchii dědičnosti objektu.

public static void IsInstanceOfType(object? value, Type? expectedType, ref Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AssertIsInstanceOfTypeInterpolatedStringHandler message, string valueExpression = "");
static member IsInstanceOfType : obj * Type * AssertIsInstanceOfTypeInterpolatedStringHandler * string -> unit
Public Shared Sub IsInstanceOfType (value As Object, expectedType As Type, ByRef message As Assert.AssertIsInstanceOfTypeInterpolatedStringHandler, Optional valueExpression As String = "")

Parametry

value
Object

Objekt, který test očekává, bude mít zadaný typ.

expectedType
Type

Očekávaný typ .value

message
Assert.AssertIsInstanceOfTypeInterpolatedStringHandler

Zpráva, která se má zahrnout do výjimky, pokud value není instance expectedType. Zpráva se zobrazí ve výsledcích testu.

valueExpression
String

Syntaktický výraz hodnoty zadaný kompilátorem prostřednictvím výrazu argumentu volajícího. Uživatelé by neměli předávat hodnotu pro tento parametr.

Platí pro

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

Zdroj:
Assert.IsInstanceOfType.cs
Zdroj:
Assert.IsInstanceOfType.cs
Zdroj:
Assert.IsInstanceOfType.cs
Zdroj:
Assert.IsInstanceOfType.cs
Zdroj:
Assert.IsInstanceOfType.cs
Zdroj:
Assert.IsInstanceOfType.cs
Zdroj:
Assert.IsInstanceOfType.cs
Zdroj:
Assert.IsInstanceOfType.cs
Zdroj:
Assert.IsInstanceOfType.cs
Zdroj:
Assert.IsInstanceOfType.cs
Zdroj:
Assert.IsInstanceOfType.cs

Testuje, zda zadaný objekt je instance očekávaného typu a vyvolá výjimku, pokud očekávaný typ není v hierarchii dědičnosti objektu.

public static void IsInstanceOfType(object value, Type expectedType, string message, params object[] parameters);
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())

Parametry

value
Object

Objekt, který test očekává, bude mít zadaný typ.

expectedType
Type

Očekávaný typ .value

message
String

Zpráva, která se má zahrnout do výjimky, pokud value není instance expectedType. Zpráva se zobrazí ve výsledcích testu.

parameters
Object[]

Pole parametrů, které se má použít při formátování message.

Výjimky

Vyvolá se, pokud value je null nebo expectedType není v hierarchii dědičnosti value.

Platí pro

IsInstanceOfType(Object, Type, Assert+AssertIsInstanceOfTypeInterpolatedStringHandler)

Zdroj:
Assert.IsInstanceOfType.cs
Zdroj:
Assert.IsInstanceOfType.cs
Zdroj:
Assert.IsInstanceOfType.cs
Zdroj:
Assert.IsInstanceOfType.cs

Testuje, zda zadaný objekt je instance očekávaného typu a vyvolá výjimku, pokud očekávaný typ není v hierarchii dědičnosti objektu.

public static void IsInstanceOfType(object? value, Type? expectedType, ref Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AssertIsInstanceOfTypeInterpolatedStringHandler message);
static member IsInstanceOfType : obj * Type * AssertIsInstanceOfTypeInterpolatedStringHandler -> unit
Public Shared Sub IsInstanceOfType (value As Object, expectedType As Type, ByRef message As Assert.AssertIsInstanceOfTypeInterpolatedStringHandler)

Parametry

value
Object

Objekt, který test očekává, bude mít zadaný typ.

expectedType
Type

Očekávaný typ .value

message
Assert.AssertIsInstanceOfTypeInterpolatedStringHandler

Zpráva, která se má zahrnout do výjimky, pokud value není instance expectedType. Zpráva se zobrazí ve výsledcích testu.

Platí pro

IsInstanceOfType(Object, Type, String)

Zdroj:
Assert.IsInstanceOfType.cs
Zdroj:
Assert.IsInstanceOfType.cs
Zdroj:
Assert.IsInstanceOfType.cs
Zdroj:
Assert.IsInstanceOfType.cs
Zdroj:
Assert.IsInstanceOfType.cs
Zdroj:
Assert.IsInstanceOfType.cs
Zdroj:
Assert.IsInstanceOfType.cs
Zdroj:
Assert.IsInstanceOfType.cs
Zdroj:
Assert.IsInstanceOfType.cs
Zdroj:
Assert.IsInstanceOfType.cs
Zdroj:
Assert.IsInstanceOfType.cs

Testuje, zda zadaný objekt je instance očekávaného typu a vyvolá výjimku, pokud očekávaný typ není v hierarchii dědičnosti objektu.

public static void IsInstanceOfType(object value, Type expectedType, string message);
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)

Parametry

value
Object

Objekt, který test očekává, bude mít zadaný typ.

expectedType
Type

Očekávaný typ .value

message
String

Zpráva, která se má zahrnout do výjimky, pokud value není instance expectedType. Zpráva se zobrazí ve výsledcích testu.

Výjimky

Vyvolá se, pokud value je null nebo expectedType není v hierarchii dědičnosti value.

Platí pro

IsInstanceOfType(Object, Type)

Zdroj:
Assert.IsInstanceOfType.cs
Zdroj:
Assert.IsInstanceOfType.cs
Zdroj:
Assert.IsInstanceOfType.cs
Zdroj:
Assert.IsInstanceOfType.cs
Zdroj:
Assert.IsInstanceOfType.cs
Zdroj:
Assert.IsInstanceOfType.cs
Zdroj:
Assert.IsInstanceOfType.cs
Zdroj:
Assert.IsInstanceOfType.cs
Zdroj:
Assert.IsInstanceOfType.cs
Zdroj:
Assert.IsInstanceOfType.cs
Zdroj:
Assert.IsInstanceOfType.cs

Testuje, zda zadaný objekt je instance očekávaného typu a vyvolá výjimku, pokud očekávaný typ není v hierarchii dědičnosti objektu.

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

Parametry

value
Object

Objekt, který test očekává, bude mít zadaný typ.

expectedType
Type

Očekávaný typ .value

Výjimky

Vyvolá se, pokud value je null nebo expectedType není v hierarchii dědičnosti value.

Platí pro

IsInstanceOfType<T>(Object, T, String)

Zdroj:
Assert.IsInstanceOfType.cs
Zdroj:
Assert.IsInstanceOfType.cs
Zdroj:
Assert.IsInstanceOfType.cs
Zdroj:
Assert.IsInstanceOfType.cs
Zdroj:
Assert.IsInstanceOfType.cs
Zdroj:
Assert.IsInstanceOfType.cs
Zdroj:
Assert.IsInstanceOfType.cs
Zdroj:
Assert.IsInstanceOfType.cs

Testuje, zda zadaný objekt je instance obecného typu a vyvolá výjimku, pokud obecný typ není v hierarchii dědičnosti objektu.

public static void IsInstanceOfType<T>(object? value, out T instance, string? message);
static member IsInstanceOfType : obj * 'T * string -> unit
Public Shared Sub IsInstanceOfType(Of T) (value As Object, ByRef instance As T, message As String)

Parametry typu

T

Očekávaný typ .value

Parametry

value
Object
instance
T
message
String

Platí pro

IsInstanceOfType<T>(Object, T, Assert.AssertGenericIsInstanceOfTypeInterpolatedStringHandler<T>)

Zdroj:
Assert.IsInstanceOfType.cs
Zdroj:
Assert.IsInstanceOfType.cs
Zdroj:
Assert.IsInstanceOfType.cs
Zdroj:
Assert.IsInstanceOfType.cs

Testuje, zda zadaný objekt je instance obecného typu a vyvolá výjimku, pokud obecný typ není v hierarchii dědičnosti objektu.

public static void IsInstanceOfType<T>(object? value, out T instance, ref Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AssertGenericIsInstanceOfTypeInterpolatedStringHandler<T> message);
static member IsInstanceOfType : obj * 'T * AssertGenericIsInstanceOfTypeInterpolatedStringHandler -> unit
Public Shared Sub IsInstanceOfType(Of T) (value As Object, ByRef instance As T, ByRef message As Assert.AssertGenericIsInstanceOfTypeInterpolatedStringHandler(Of T))

Parametry typu

T

Očekávaný typ .value

Parametry

value
Object
instance
T

Platí pro

IsInstanceOfType<T>(Object, String, String)

Zdroj:
Assert.IsInstanceOfType.cs
Zdroj:
Assert.IsInstanceOfType.cs

Testuje, zda zadaný objekt je instance obecného typu a vyvolá výjimku, pokud obecný typ není v hierarchii dědičnosti objektu.

public static T IsInstanceOfType<T>(object? value, string? message = "", string valueExpression = "");
static member IsInstanceOfType : obj * string * string -> 'T
Public Shared Function IsInstanceOfType(Of T) (value As Object, Optional message As String = "", Optional valueExpression As String = "") As T

Parametry typu

T

Očekávaný typ .value

Parametry

value
Object
message
String
valueExpression
String

Návraty

T

Platí pro

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

Zdroj:
Assert.IsInstanceOfType.cs
Zdroj:
Assert.IsInstanceOfType.cs
Zdroj:
Assert.IsInstanceOfType.cs
Zdroj:
Assert.IsInstanceOfType.cs
Zdroj:
Assert.IsInstanceOfType.cs
Zdroj:
Assert.IsInstanceOfType.cs
Zdroj:
Assert.IsInstanceOfType.cs
Zdroj:
Assert.IsInstanceOfType.cs
Zdroj:
Assert.IsInstanceOfType.cs
Zdroj:
Assert.IsInstanceOfType.cs
Zdroj:
Assert.IsInstanceOfType.cs

Testuje, zda zadaný objekt je instance obecného typu a vyvolá výjimku, pokud obecný typ není v hierarchii dědičnosti objektu.

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

Parametry typu

T

Očekávaný typ .value

Parametry

value
Object
message
String
parameters
Object[]

Platí pro

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

Zdroj:
Assert.IsInstanceOfType.cs
Zdroj:
Assert.IsInstanceOfType.cs
Zdroj:
Assert.IsInstanceOfType.cs
Zdroj:
Assert.IsInstanceOfType.cs
Zdroj:
Assert.IsInstanceOfType.cs
Zdroj:
Assert.IsInstanceOfType.cs
Zdroj:
Assert.IsInstanceOfType.cs
Zdroj:
Assert.IsInstanceOfType.cs

Testuje, zda zadaný objekt je instance obecného typu a vyvolá výjimku, pokud obecný typ není v hierarchii dědičnosti objektu.

public static void IsInstanceOfType<T>(object? value, out T instance, string? message, params object?[]? parameters);
static member IsInstanceOfType : obj * 'T * string * obj[] -> unit
Public Shared Sub IsInstanceOfType(Of T) (value As Object, ByRef instance As T, message As String, ParamArray parameters As Object())

Parametry typu

T

Očekávaný typ .value

Parametry

value
Object
instance
T
message
String
parameters
Object[]

Platí pro

IsInstanceOfType<T>(Object, T)

Zdroj:
Assert.IsInstanceOfType.cs
Zdroj:
Assert.IsInstanceOfType.cs
Zdroj:
Assert.IsInstanceOfType.cs
Zdroj:
Assert.IsInstanceOfType.cs
Zdroj:
Assert.IsInstanceOfType.cs
Zdroj:
Assert.IsInstanceOfType.cs
Zdroj:
Assert.IsInstanceOfType.cs
Zdroj:
Assert.IsInstanceOfType.cs

Testuje, zda zadaný objekt je instance obecného typu a vyvolá výjimku, pokud obecný typ není v hierarchii dědičnosti objektu.

public static void IsInstanceOfType<T>(object? value, out T instance);
static member IsInstanceOfType : obj * 'T -> unit
Public Shared Sub IsInstanceOfType(Of T) (value As Object, ByRef instance As T)

Parametry typu

T

Očekávaný typ .value

Parametry

value
Object
instance
T

Platí pro

IsInstanceOfType<T>(Object, String)

Zdroj:
Assert.IsInstanceOfType.cs
Zdroj:
Assert.IsInstanceOfType.cs
Zdroj:
Assert.IsInstanceOfType.cs
Zdroj:
Assert.IsInstanceOfType.cs
Zdroj:
Assert.IsInstanceOfType.cs
Zdroj:
Assert.IsInstanceOfType.cs
Zdroj:
Assert.IsInstanceOfType.cs
Zdroj:
Assert.IsInstanceOfType.cs
Zdroj:
Assert.IsInstanceOfType.cs
Zdroj:
Assert.IsInstanceOfType.cs
Zdroj:
Assert.IsInstanceOfType.cs

Testuje, zda zadaný objekt je instance obecného typu a vyvolá výjimku, pokud obecný typ není v hierarchii dědičnosti objektu.

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

Parametry typu

T

Očekávaný typ .value

Parametry

value
Object
message
String

Platí pro

IsInstanceOfType<T>(Object, Assert.AssertGenericIsInstanceOfTypeInterpolatedStringHandler<T>)

Zdroj:
Assert.IsInstanceOfType.cs
Zdroj:
Assert.IsInstanceOfType.cs
Zdroj:
Assert.IsInstanceOfType.cs
Zdroj:
Assert.IsInstanceOfType.cs

Testuje, zda zadaný objekt je instance obecného typu a vyvolá výjimku, pokud obecný typ není v hierarchii dědičnosti objektu.

public static void IsInstanceOfType<T>(object? value, ref Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AssertGenericIsInstanceOfTypeInterpolatedStringHandler<T> message);
static member IsInstanceOfType : obj * AssertGenericIsInstanceOfTypeInterpolatedStringHandler -> unit
Public Shared Sub IsInstanceOfType(Of T) (value As Object, ByRef message As Assert.AssertGenericIsInstanceOfTypeInterpolatedStringHandler(Of T))

Parametry typu

T

Očekávaný typ .value

Parametry

value
Object

Platí pro

IsInstanceOfType<T>(Object)

Zdroj:
Assert.IsInstanceOfType.cs
Zdroj:
Assert.IsInstanceOfType.cs
Zdroj:
Assert.IsInstanceOfType.cs
Zdroj:
Assert.IsInstanceOfType.cs
Zdroj:
Assert.IsInstanceOfType.cs
Zdroj:
Assert.IsInstanceOfType.cs
Zdroj:
Assert.IsInstanceOfType.cs
Zdroj:
Assert.IsInstanceOfType.cs
Zdroj:
Assert.IsInstanceOfType.cs
Zdroj:
Assert.IsInstanceOfType.cs
Zdroj:
Assert.IsInstanceOfType.cs

Testuje, zda zadaný objekt je instance obecného typu a vyvolá výjimku, pokud obecný typ není v hierarchii dědičnosti objektu.

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

Parametry typu

T

Očekávaný typ .value

Parametry

value
Object

Platí pro

IsInstanceOfType<T>(Object, Assert.AssertGenericIsInstanceOfTypeInterpolatedStringHandler<T>, String)

Zdroj:
Assert.IsInstanceOfType.cs
Zdroj:
Assert.IsInstanceOfType.cs

Testuje, zda zadaný objekt je instance obecného typu a vyvolá výjimku, pokud obecný typ není v hierarchii dědičnosti objektu.

public static T IsInstanceOfType<T>(object? value, ref Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AssertGenericIsInstanceOfTypeInterpolatedStringHandler<T> message, string valueExpression = "");
static member IsInstanceOfType : obj * AssertGenericIsInstanceOfTypeInterpolatedStringHandler * string -> 'T
Public Shared Function IsInstanceOfType(Of T) (value As Object, ByRef message As Assert.AssertGenericIsInstanceOfTypeInterpolatedStringHandler(Of T), Optional valueExpression As String = "") As T

Parametry typu

T

Očekávaný typ .value

Parametry

value
Object
valueExpression
String

Návraty

T

Platí pro