Interface IMethodInfo
- Namespace
- NUnit.Framework.Interfaces
- Assembly
- nunit.framework.dll
The IMethodInfo class is used to encapsulate information about a method in a platform-independent manner.
public interface IMethodInfo : IReflectionInfo
- Inherited Members
Properties
ContainsGenericParameters
Gets a value indicating whether the method contains unassigned generic type parameters.
bool ContainsGenericParameters { get; }
Property Value
IsAbstract
Gets a value indicating whether the method is abstract.
bool IsAbstract { get; }
Property Value
IsGenericMethod
Gets a value indicating whether the method is a generic method.
bool IsGenericMethod { get; }
Property Value
IsGenericMethodDefinition
Gets a value indicating whether the MethodInfo represents the definition of a generic method.
bool IsGenericMethodDefinition { get; }
Property Value
IsPublic
Gets a value indicating whether the method is public.
bool IsPublic { get; }
Property Value
IsStatic
Gets a value indicating whether the method is static.
bool IsStatic { get; }
Property Value
MethodInfo
Gets the MethodInfo for this method.
MethodInfo MethodInfo { get; }
Property Value
Name
Gets the name of the method.
string Name { get; }
Property Value
ReturnType
Gets the return Type of the method.
ITypeInfo ReturnType { get; }
Property Value
TypeInfo
Gets the Type from which this method was reflected.
ITypeInfo TypeInfo { get; }
Property Value
Methods
GetGenericArguments()
Returns the Type arguments of a generic method or the Type parameters of a generic method definition.
Type[] GetGenericArguments()
Returns
- Type[]
GetParameters()
Gets the parameters of the method.
IParameterInfo[] GetParameters()
Returns
Invoke(object?, params object?[]?)
Invokes the method, converting any TargetInvocationException to an NUnitException.
object? Invoke(object? fixture, params object?[]? args)
Parameters
fixture
objectThe object on which to invoke the method
args
object[]The argument list for the method
Returns
- object
The return value from the invoked method
MakeGenericMethod(params Type[])
Replaces the type parameters of the method with the array of types provided and returns a new IMethodInfo.
IMethodInfo MakeGenericMethod(params Type[] typeArguments)
Parameters
typeArguments
Type[]The type arguments to be used
Returns
- IMethodInfo
A new IMethodInfo with the type arguments replaced