C# Класс NUnit.Framework.Internal.TypeHelper

TypeHelper provides static methods that operate on Types.
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
BestCommonType ( Type type1, Type type2 ) : Type

Returns the best fit for a common type to be used in matching actual arguments to a methods Type parameters.

CanDeduceTypeArgsFromArgs ( Type type, object arglist, Type &typeArgsOut ) : bool

Determines whether this instance can deduce type args for a generic type from the supplied arguments.

ConvertArgumentList ( object arglist, ParameterInfo parameters ) : void

Convert an argument list to the required paramter types. Currently, only widening numeric conversions are performed.

GetDisplayName ( Type type ) : string

Gets the display name for a Type as used by NUnit.

GetDisplayName ( Type type, object arglist ) : string

Gets the display name for a Type as used by NUnit.

GetEnumValues ( Type enumType ) : Array

Gets the values for an enumeration, using Enum.GetTypes where available, otherwise through reflection.

IsNumeric ( Type type ) : bool

Determines whether the specified type is numeric.

MakeGenericType ( Type type, Type typeArgs ) : Type

Creates an instance of a generic Type using the supplied Type arguments

Описание методов

BestCommonType() публичный статический Метод

Returns the best fit for a common type to be used in matching actual arguments to a methods Type parameters.
public static BestCommonType ( Type type1, Type type2 ) : Type
type1 System.Type The first type.
type2 System.Type The second type.
Результат System.Type

CanDeduceTypeArgsFromArgs() публичный статический Метод

Determines whether this instance can deduce type args for a generic type from the supplied arguments.
public static CanDeduceTypeArgsFromArgs ( Type type, object arglist, Type &typeArgsOut ) : bool
type System.Type The type to be examined.
arglist object The arglist.
typeArgsOut System.Type The type args to be used.
Результат bool

ConvertArgumentList() публичный статический Метод

Convert an argument list to the required paramter types. Currently, only widening numeric conversions are performed.
public static ConvertArgumentList ( object arglist, ParameterInfo parameters ) : void
arglist object An array of args to be converted
parameters System.Reflection.ParameterInfo A ParamterInfo[] whose types will be used as targets
Результат void

GetDisplayName() публичный статический Метод

Gets the display name for a Type as used by NUnit.
public static GetDisplayName ( Type type ) : string
type System.Type The Type for which a display name is needed.
Результат string

GetDisplayName() публичный статический Метод

Gets the display name for a Type as used by NUnit.
public static GetDisplayName ( Type type, object arglist ) : string
type System.Type The Type for which a display name is needed.
arglist object The arglist provided.
Результат string

GetEnumValues() публичный статический Метод

Gets the values for an enumeration, using Enum.GetTypes where available, otherwise through reflection.
public static GetEnumValues ( Type enumType ) : Array
enumType System.Type
Результат System.Array

IsNumeric() публичный статический Метод

Determines whether the specified type is numeric.
public static IsNumeric ( Type type ) : bool
type System.Type The type to be examined.
Результат bool

MakeGenericType() публичный статический Метод

Creates an instance of a generic Type using the supplied Type arguments
public static MakeGenericType ( Type type, Type typeArgs ) : Type
type System.Type The generic type to be specialized.
typeArgs System.Type The type args.
Результат System.Type