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