Search Results for

    Show / Hide Table of Contents

    Interface IMethodInfo

    The IMethodInfo class is used to encapsulate information about a method in a platform-independent manner.

    Inherited Members
    IReflectionInfo.GetCustomAttributes<T>(bool)
    IReflectionInfo.IsDefined<T>(bool)
    Namespace: NUnit.Framework.Interfaces
    Assembly: nunit.framework.dll
    Syntax
    public interface IMethodInfo : IReflectionInfo

    Properties

    View Source

    ContainsGenericParameters

    Gets a value indicating whether the method contains unassigned generic type parameters.

    Declaration
    bool ContainsGenericParameters { get; }
    Property Value
    Type Description
    bool
    View Source

    IsAbstract

    Gets a value indicating whether the method is abstract.

    Declaration
    bool IsAbstract { get; }
    Property Value
    Type Description
    bool
    View Source

    IsGenericMethod

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

    Declaration
    bool IsGenericMethod { get; }
    Property Value
    Type Description
    bool
    View Source

    IsGenericMethodDefinition

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

    Declaration
    bool IsGenericMethodDefinition { get; }
    Property Value
    Type Description
    bool
    View Source

    IsPublic

    Gets a value indicating whether the method is public.

    Declaration
    bool IsPublic { get; }
    Property Value
    Type Description
    bool
    View Source

    IsStatic

    Gets a value indicating whether the method is static.

    Declaration
    bool IsStatic { get; }
    Property Value
    Type Description
    bool
    View Source

    MethodInfo

    Gets the MethodInfo for this method.

    Declaration
    MethodInfo MethodInfo { get; }
    Property Value
    Type Description
    MethodInfo
    View Source

    Name

    Gets the name of the method.

    Declaration
    string Name { get; }
    Property Value
    Type Description
    string
    View Source

    ReturnType

    Gets the return Type of the method.

    Declaration
    ITypeInfo ReturnType { get; }
    Property Value
    Type Description
    ITypeInfo
    View Source

    TypeInfo

    Gets the Type from which this method was reflected.

    Declaration
    ITypeInfo TypeInfo { get; }
    Property Value
    Type Description
    ITypeInfo

    Methods

    View Source

    GetGenericArguments()

    Returns the Type arguments of a generic method or the Type parameters of a generic method definition.

    Declaration
    Type[] GetGenericArguments()
    Returns
    Type Description
    Type[]
    View Source

    GetParameters()

    Gets the parameters of the method.

    Declaration
    IParameterInfo[] GetParameters()
    Returns
    Type Description
    IParameterInfo[]
    View Source

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

    Invokes the method, converting any TargetInvocationException to an NUnitException.

    Declaration
    object? Invoke(object? fixture, params object?[]? args)
    Parameters
    Type Name Description
    object fixture

    The object on which to invoke the method

    object[] args

    The argument list for the method

    Returns
    Type Description
    object

    The return value from the invoked method

    View Source

    MakeGenericMethod(params Type[])

    Replaces the type parameters of the method with the array of types provided and returns a new IMethodInfo.

    Declaration
    IMethodInfo MakeGenericMethod(params Type[] typeArguments)
    Parameters
    Type Name Description
    Type[] typeArguments

    The type arguments to be used

    Returns
    Type Description
    IMethodInfo

    A new IMethodInfo with the type arguments replaced

    • View Source
    In this article
    Back to top Generated by DocFX | Copyright (c) 2018- The NUnit Project - Licensed under CC BY-NC-SA 4.0