Reflect
Helper methods for inspecting a type by reflection.
Many of these methods take ICustomAttributeProvider as an
argument to avoid duplication, even though certain attributes can
only appear on specific types of members, like MethodInfo or Type.
In the case where a type is being examined for the presence of
an attribute, interface or named member, the Reflect methods
operate with the full name of the member being sought. This
removes the necessity of the caller having a reference to the
assembly that defines the item being sought and allows the
NUnit core to inspect assemblies that reference an older
version of the NUnit framework.
Invoke the default constructor on a Type
Invoke a constructor on a Type with arguments
Returns the get accessor for the indexer.
public static MemberInfo[] GetMemberIncludingFromBase(this Type type, string name, BindingFlags flags)
Searches for the specified members, using the specified binding constraints.
public static PropertyInfo GetUltimateShadowingProperty(Type type, string name, BindingFlags bindingFlags)
Selects the ultimate shadowing property just like dynamic would, rather than throwing AmbiguousMatchException for properties that shadow properties of a different property type which is what GetProperty does.
If you request both public and nonpublic properties, every public property is preferred over every nonpublic property. It would violate the principle of least surprise for a derived class’s implementation detail to be chosen over the public API for a type.
Examine a fixture type and return true if it has a method with
a particular attribute.
Invoke a parameterless method returning void on an object.
Invoke a method, converting any TargetInvocationException to an NUnitException.