C# Class NUnit.Framework.Internal.TypeHelper

TypeHelper provides static methods that operate on Types.
Afficher le fichier Open project: pjcollins/Andr.Unit Class Usage Examples

Méthodes publiques

Méthode Description
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

Method Details

BestCommonType() public static méthode

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.
Résultat System.Type

CanDeduceTypeArgsFromArgs() public static méthode

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.
Résultat bool

ConvertArgumentList() public static méthode

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
Résultat void

GetDisplayName() public static méthode

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.
Résultat string

GetDisplayName() public static méthode

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.
Résultat string

GetEnumValues() public static méthode

Gets the values for an enumeration, using Enum.GetTypes where available, otherwise through reflection.
public static GetEnumValues ( Type enumType ) : Array
enumType System.Type
Résultat System.Array

IsNumeric() public static méthode

Determines whether the specified type is numeric.
public static IsNumeric ( Type type ) : bool
type System.Type The type to be examined.
Résultat bool

MakeGenericType() public static méthode

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.
Résultat System.Type