Table of Contents

Method ConvertArgument

Namespace
Xunit.Sdk
Assembly
xunit.v3.common.dll

ConvertArgument(object?, Type)

Converts an argument into its target type. Can be particularly useful when pulling attribute constructor arguments, whose types may not strictly match the parameter type.

public static object? ConvertArgument(object? arg, Type type)

Parameters

arg object

The argument to be converted.

type Type

The target type for the conversion.

Returns

object

The converted argument.