Table of Contents

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

object object

The object to be evaluated

Returns

T

The object, casted to type T when successful

Type Parameters

T

The 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

expectedType Type

The type the object should be

object object

The object to be evaluated

Exceptions

Thrown when the object is not the given type