Table of Contents

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

bool

IsAbstract

Gets a value indicating whether the method is abstract.

bool IsAbstract { get; }

Property Value

bool

IsGenericMethod

Gets a value indicating whether the method is a generic method.

bool IsGenericMethod { get; }

Property Value

bool

IsGenericMethodDefinition

Gets a value indicating whether the MethodInfo represents the definition of a generic method.

bool IsGenericMethodDefinition { get; }

Property Value

bool

IsPublic

Gets a value indicating whether the method is public.

bool IsPublic { get; }

Property Value

bool

IsStatic

Gets a value indicating whether the method is static.

bool IsStatic { get; }

Property Value

bool

MethodInfo

Gets the MethodInfo for this method.

MethodInfo MethodInfo { get; }

Property Value

MethodInfo

Name

Gets the name of the method.

string Name { get; }

Property Value

string

ReturnType

Gets the return Type of the method.

ITypeInfo ReturnType { get; }

Property Value

ITypeInfo

TypeInfo

Gets the Type from which this method was reflected.

ITypeInfo TypeInfo { get; }

Property Value

ITypeInfo

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

IParameterInfo[]

Invoke(object?, params object?[]?)

Invokes the method, converting any TargetInvocationException to an NUnitException.

object? Invoke(object? fixture, params object?[]? args)

Parameters

fixture object

The 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