Class DefaultNamespaceTypeWrapper
The TypeWrapper class wraps a Type so it may be used in
a platform-independent manner. This class overrides the
namespace to return null
so it is only run once per
assembly.
Inheritance
System.Object
DefaultNamespaceTypeWrapper
Implements
NUnit.Framework.Interfaces.ITypeInfo
NUnit.Framework.Interfaces.IReflectionInfo
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
Assembly: Lucene.Net.TestFramework.dll
Syntax
public class DefaultNamespaceTypeWrapper : ITypeInfo, IReflectionInfo
Constructors
|
Improve this Doc
View Source
DefaultNamespaceTypeWrapper(Type)
Construct a TypeWrapper for a specified Type.
Declaration
public DefaultNamespaceTypeWrapper(Type type)
Parameters
Type |
Name |
Description |
System.Type |
type |
|
Properties
|
Improve this Doc
View Source
Assembly
Gets the assembly in which the type is declared
Declaration
public Assembly Assembly { get; }
Property Value
Type |
Description |
System.Reflection.Assembly |
|
|
Improve this Doc
View Source
BaseType
Gets the base type of this type as an ITypeInfo
Declaration
public ITypeInfo BaseType { get; }
Property Value
Type |
Description |
NUnit.Framework.Interfaces.ITypeInfo |
|
|
Improve this Doc
View Source
ContainsGenericParameters
Gets a value indicating whether the Type has generic parameters that have not been replaced by specific Types.
Declaration
public bool ContainsGenericParameters { get; }
Property Value
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
FullName
Gets the FullName of the Type
Declaration
public string FullName { get; }
Property Value
Type |
Description |
System.String |
|
|
Improve this Doc
View Source
IsAbstract
Gets a value indicating whether the type is abstract.
Declaration
public bool IsAbstract { get; }
Property Value
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
IsGenericType
Gets a value indicating whether the Type is a generic Type
Declaration
public bool IsGenericType { get; }
Property Value
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
IsGenericTypeDefinition
Gets a value indicating whether the Type is a generic Type definition
Declaration
public bool IsGenericTypeDefinition { get; }
Property Value
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
IsSealed
Gets a value indicating whether the type is sealed.
Declaration
public bool IsSealed { get; }
Property Value
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
IsStaticClass
Gets a value indicating whether this type represents a static class.
Declaration
public bool IsStaticClass { get; }
Property Value
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
Name
Gets the Name of the Type
Declaration
public string Name { get; }
Property Value
Type |
Description |
System.String |
|
|
Improve this Doc
View Source
Namespace
Gets the namespace of the Type
Declaration
public string Namespace { get; }
Property Value
Type |
Description |
System.String |
|
|
Improve this Doc
View Source
Type
Gets the underlying Type on which this TypeWrapper is based.
Declaration
public Type Type { get; }
Property Value
Type |
Description |
System.Type |
|
Methods
|
Improve this Doc
View Source
Construct(Object[])
Construct an object of this Type, using the specified arguments.
Declaration
public object Construct(object[] args)
Parameters
Type |
Name |
Description |
System.Object[] |
args |
|
Returns
Type |
Description |
System.Object |
|
|
Improve this Doc
View Source
GetConstructor(Type[])
Gets the public constructor taking the specified argument Types
Declaration
public ConstructorInfo GetConstructor(Type[] argTypes)
Parameters
Type |
Name |
Description |
System.Type[] |
argTypes |
|
Returns
Type |
Description |
System.Reflection.ConstructorInfo |
|
|
Improve this Doc
View Source
GetCustomAttributes<T>(Boolean)
Returns an array of custom attributes of the specified type applied to this type
Declaration
public T[] GetCustomAttributes<T>(bool inherit)
where T : class
Parameters
Type |
Name |
Description |
System.Boolean |
inherit |
|
Returns
Type Parameters
|
Improve this Doc
View Source
GetDisplayName()
Get the display name for this type
Declaration
public string GetDisplayName()
Returns
Type |
Description |
System.String |
|
|
Improve this Doc
View Source
GetDisplayName(Object[])
Get the display name for an object of this type, constructed with the specified args.
Declaration
public string GetDisplayName(object[] args)
Parameters
Type |
Name |
Description |
System.Object[] |
args |
|
Returns
Type |
Description |
System.String |
|
|
Improve this Doc
View Source
GetGenericTypeDefinition()
Returns a Type representing a generic type definition from which this Type can be constructed.
Declaration
public Type GetGenericTypeDefinition()
Returns
Type |
Description |
System.Type |
|
|
Improve this Doc
View Source
GetMethods(BindingFlags)
Returns an array of IMethodInfos for methods of this Type
that match the specified flags.
Declaration
public IMethodInfo[] GetMethods(BindingFlags flags)
Parameters
Type |
Name |
Description |
System.Reflection.BindingFlags |
flags |
|
Returns
Type |
Description |
NUnit.Framework.Interfaces.IMethodInfo[] |
|
|
Improve this Doc
View Source
GetMethodsWithAttribute<T>(Boolean)
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
public IMethodInfo[] GetMethodsWithAttribute<T>(bool inherit)
where T : class
Parameters
Type |
Name |
Description |
System.Boolean |
inherit |
Specifies whether to search the fixture type inheritance chain.
|
Returns
Type |
Description |
NUnit.Framework.Interfaces.IMethodInfo[] |
|
Type Parameters
|
Improve this Doc
View Source
HasConstructor(Type[])
Returns a value indicating whether this Type has a public constructor taking the specified argument Types.
Declaration
public bool HasConstructor(Type[] argTypes)
Parameters
Type |
Name |
Description |
System.Type[] |
argTypes |
|
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
HasMethodWithAttribute(Type)
Returns a flag indicating whether this type has a method with an attribute of the specified type.
Declaration
public bool HasMethodWithAttribute(Type attributeType)
Parameters
Type |
Name |
Description |
System.Type |
attributeType |
|
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
IsDefined<T>(Boolean)
Returns a value indicating whether the type has an attribute of the specified type.
Declaration
public bool IsDefined<T>(bool inherit)
where T : class
Parameters
Type |
Name |
Description |
System.Boolean |
inherit |
|
Returns
Type |
Description |
System.Boolean |
|
Type Parameters
|
Improve this Doc
View Source
IsType(Type)
Returns true if the Type wrapped is T
Declaration
public bool IsType(Type type)
Parameters
Type |
Name |
Description |
System.Type |
type |
|
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
MakeGenericType(Type[])
Returns a new ITypeInfo representing an instance of this generic Type using the supplied Type arguments
Declaration
public ITypeInfo MakeGenericType(Type[] typeArgs)
Parameters
Type |
Name |
Description |
System.Type[] |
typeArgs |
|
Returns
Type |
Description |
NUnit.Framework.Interfaces.ITypeInfo |
|
|
Improve this Doc
View Source
ToString()
Override ToString() so that error messages in NUnit's own tests make sense
Declaration
public override string ToString()
Returns
Type |
Description |
System.String |
|
Overrides
System.Object.ToString()
Implements
NUnit.Framework.Interfaces.ITypeInfo
NUnit.Framework.Interfaces.IReflectionInfo