IGLib  1.7.2
The IGLib base library EXTENDED - with other lilbraries and applications.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros
NUnit.Framework.Internal.TypeHelper Class Reference

TypeHelper provides static methods that operate on Types. More...

Classes

class  NonmatchingTypeClass
 

Static Public Member Functions

static string GetDisplayName (Type type)
 Gets the display name for a Type as used by NUnit. More...
 
static string GetDisplayName (Type type, object[] arglist)
 Gets the display name for a Type as used by NUnit. More...
 
static Type BestCommonType (Type type1, Type type2)
 Returns the best fit for a common type to be used in matching actual arguments to a methods Type parameters. More...
 
static bool IsNumeric (Type type)
 Determines whether the specified type is numeric. More...
 
static void ConvertArgumentList (object[] arglist, IParameterInfo[] parameters)
 Convert an argument list to the required parameter types. Currently, only widening numeric conversions are performed. More...
 
static bool CanDeduceTypeArgsFromArgs (Type type, object[] arglist, ref Type[] typeArgsOut)
 Determines whether this instance can deduce type args for a generic type from the supplied arguments. More...
 
static Array GetEnumValues (Type enumType)
 Gets the _values for an enumeration, using Enum.GetTypes where available, otherwise through reflection. More...
 
static string[] GetEnumNames (Type enumType)
 Gets the ids of the _values for an enumeration, using Enum.GetNames where available, otherwise through reflection. More...
 

Static Public Attributes

static readonly Type NonmatchingType = typeof( NonmatchingTypeClass )
 A special value, which is used to indicate that BestCommonType() method was unable to find a common type for the specified arguments. More...
 

Private Attributes

const int STRING_MAX = 40
 
const int STRING_LIMIT = STRING_MAX - 3
 
const string THREE_DOTS = "..."
 

Detailed Description

TypeHelper provides static methods that operate on Types.

Member Function Documentation

static string NUnit.Framework.Internal.TypeHelper.GetDisplayName ( Type  type)
inlinestatic

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

Parameters
typeThe Type for which a display name is needed.
Returns
The display name for the Type

Referenced by NUnit.Framework.Internal.TypeWrapper.GetDisplayName(), and NUnit.Framework.Internal.TypeHelperTests.GetDisplayNameTests().

static string NUnit.Framework.Internal.TypeHelper.GetDisplayName ( Type  type,
object[]  arglist 
)
inlinestatic

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

Parameters
typeThe Type for which a display name is needed.
arglistThe arglist provided.
Returns
The display name for the Type
static Type NUnit.Framework.Internal.TypeHelper.BestCommonType ( Type  type1,
Type  type2 
)
inlinestatic

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

Parameters
type1The first type.
type2The second type.
Returns
Either type1 or type2, depending on which is more general.

References NUnit.Framework.Internal.TypeHelper.IsNumeric(), and NUnit.Framework.Internal.TypeHelper.NonmatchingType.

Referenced by NUnit.Framework.Internal.GenericMethodHelper.ApplyArgType(), NUnit.Framework.Internal.TypeHelperTests.BestCommonTypeTest(), and NUnit.Framework.Internal.TypeHelper.CanDeduceTypeArgsFromArgs().

static bool NUnit.Framework.Internal.TypeHelper.IsNumeric ( Type  type)
inlinestatic

Determines whether the specified type is numeric.

Parameters
typeThe type to be examined.
Returns
true if the specified type is numeric; otherwise, false.

Referenced by NUnit.Framework.Internal.TypeHelper.BestCommonType().

static void NUnit.Framework.Internal.TypeHelper.ConvertArgumentList ( object[]  arglist,
IParameterInfo[]  parameters 
)
inlinestatic

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

Parameters
arglistAn array of args to be converted
parametersA ParameterInfo[] whose types will be used as targets

References NUnit.Framework.Interfaces.IParameterInfo.ParameterType.

Referenced by NUnit.Framework.Internal.Builders.NUnitTestCaseBuilder.CheckTestMethodSignature().

static bool NUnit.Framework.Internal.TypeHelper.CanDeduceTypeArgsFromArgs ( Type  type,
object[]  arglist,
ref Type[]  typeArgsOut 
)
inlinestatic

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

Parameters
typeThe type to be examined.
arglistThe arglist.
typeArgsOutThe type args to be used.
Returns
true if this the provided args give sufficient information to determine the type args to be used; otherwise, false.

References NUnit.Framework.Internal.TypeHelper.BestCommonType().

Referenced by NUnit.Framework.Internal.Builders.NUnitTestFixtureBuilder.BuildFrom().

static Array NUnit.Framework.Internal.TypeHelper.GetEnumValues ( Type  enumType)
inlinestatic

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

Parameters
enumType
Returns

Referenced by NUnit.Framework.ValuesAttribute.GetData(), NUnit.Framework.Internal.Builders.DatapointProvider.GetDataFor(), and NUnit.Framework.Internal.Randomizer.NextEnum().

static string [] NUnit.Framework.Internal.TypeHelper.GetEnumNames ( Type  enumType)
inlinestatic

Gets the ids of the _values for an enumeration, using Enum.GetNames where available, otherwise through reflection.

Parameters
enumType
Returns

Referenced by NUnit.Framework.Internal.RuntimeFramework.IsRuntimeTypeName().

Member Data Documentation

const int NUnit.Framework.Internal.TypeHelper.STRING_MAX = 40
private
const int NUnit.Framework.Internal.TypeHelper.STRING_LIMIT = STRING_MAX - 3
private
const string NUnit.Framework.Internal.TypeHelper.THREE_DOTS = "..."
private
readonly Type NUnit.Framework.Internal.TypeHelper.NonmatchingType = typeof( NonmatchingTypeClass )
static

A special value, which is used to indicate that BestCommonType() method was unable to find a common type for the specified arguments.

Referenced by NUnit.Framework.Internal.TypeHelper.BestCommonType(), and NUnit.Framework.Internal.Builders.NUnitTestCaseBuilder.CheckTestMethodSignature().


The documentation for this class was generated from the following file: