Interface ITypeInfo
The ITypeInfo interface is an abstraction of a .NET Type
Assembly: nunit.framework.dll
Syntax
public interface ITypeInfo : IReflectionInfo
Properties
View Source
Assembly
Gets the assembly in which the type is declared
Declaration
Assembly Assembly { get; }
Property Value
View Source
BaseType
Gets the base type of this type as an ITypeInfo
Declaration
ITypeInfo? BaseType { get; }
Property Value
View Source
ContainsGenericParameters
Gets a value indicating whether the Type has generic parameters that have not been replaced by specific Types.
Declaration
bool ContainsGenericParameters { get; }
Property Value
View Source
FullName
Gets the full name of the Type
Declaration
Property Value
View Source
IsAbstract
Gets a value indicating whether the type is abstract.
Declaration
Property Value
View Source
IsGenericType
Gets a value indicating whether the Type is a generic Type
Declaration
bool IsGenericType { get; }
Property Value
View Source
IsGenericTypeDefinition
Gets a value indicating whether the Type is a generic Type definition
Declaration
bool IsGenericTypeDefinition { get; }
Property Value
View Source
IsSealed
Gets a value indicating whether the type is sealed.
Declaration
Property Value
View Source
IsStaticClass
Gets a value indicating whether this type is a static class.
Declaration
bool IsStaticClass { get; }
Property Value
View Source
Name
Gets the name of the Type
Declaration
Property Value
View Source
Namespace
Gets the namespace of the Type
Declaration
string? Namespace { get; }
Property Value
View Source
Type
Gets the underlying Type on which this ITypeInfo is based
Declaration
Property Value
Methods
View Source
Construct(object?[]?)
Construct an object of this Type, using the specified arguments.
Declaration
object Construct(object?[]? args)
Parameters
Type |
Name |
Description |
object[] |
args |
|
Returns
View Source
GetConstructor(Type[])
Gets the public constructor taking the specified argument Types
Declaration
ConstructorInfo? GetConstructor(Type[] argTypes)
Parameters
Type |
Name |
Description |
Type[] |
argTypes |
|
Returns
View Source
GetDisplayName()
Get the display name for this typeInfo.
Declaration
Returns
View Source
GetDisplayName(object?[]?)
Get the display name for an object of this type, constructed with specific arguments
Declaration
string GetDisplayName(object?[]? args)
Parameters
Type |
Name |
Description |
object[] |
args |
|
Returns
View Source
GetGenericTypeDefinition()
Returns a Type representing a generic type definition from which this Type can be constructed.
Declaration
Type GetGenericTypeDefinition()
Returns
View Source
GetMethods(BindingFlags)
Returns an array of IMethodInfos for methods of this Type
that match the specified flags.
Declaration
IMethodInfo[] GetMethods(BindingFlags flags)
Parameters
Returns
View Source
GetMethodsWithAttribute<T>(bool)
Returns all methods declared by this type that have the specified attribute, optionally
including base classes. Methods from a base class are always returned before methods from a class that
inherits from it.
Declaration
IMethodInfo[] GetMethodsWithAttribute<T>(bool inherit) where T : class
Parameters
Type |
Name |
Description |
bool |
inherit |
Specifies whether to search the fixture type inheritance chain.
|
Returns
Type Parameters
View Source
HasConstructor(Type[])
Returns a value indicating whether this Type has a public constructor taking the specified argument Types.
Declaration
bool HasConstructor(Type[] argTypes)
Parameters
Type |
Name |
Description |
Type[] |
argTypes |
|
Returns
View Source
HasMethodWithAttribute(Type)
Returns a value indicating whether this type has a method with a specified public attribute
Declaration
bool HasMethodWithAttribute(Type attrType)
Parameters
Type |
Name |
Description |
Type |
attrType |
|
Returns
View Source
IsType(Type)
Returns true if the Type wrapped is equal to the argument
Declaration
Parameters
Type |
Name |
Description |
Type |
type |
|
Returns
View Source
MakeGenericType(Type[])
Returns a new ITypeInfo representing an instance of this generic Type using the supplied Type arguments
Declaration
ITypeInfo MakeGenericType(Type[] typeArgs)
Parameters
Type |
Name |
Description |
Type[] |
typeArgs |
|
Returns