Method IsAssignableFrom
- Namespace
- Xunit
- Assembly
- xunit.v3.assert.dll
IsAssignableFrom<T>(object?)
Verifies that an object is of the given type or a derived type.
public static T IsAssignableFrom<T>(object? @object)
Parameters
objectobjectThe object to be evaluated
Returns
- T
The object, casted to type T when successful
Type Parameters
TThe type the object should be
Exceptions
Thrown when the object is not the given type
IsAssignableFrom(Type, object?)
Verifies that an object is of the given type or a derived type.
public static void IsAssignableFrom(Type expectedType, object? @object)
Parameters
Exceptions
Thrown when the object is not the given type