Class GenericMethod

Namespace: AutoFixture.Kernel
Assembly: AutoFixture.dll

Encapsulates a generic method, inferring the type parameters bases on invocation arguments.

public class GenericMethod : IMethod

Inheritance

objectGenericMethod

Implements

IMethod

Inherited Members

object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

Constructors

GenericMethod(MethodInfo, IMethodFactory)

Initializes a new instance of the GenericMethod class.

public GenericMethod(MethodInfo method, IMethodFactory factory)

Parameters

method MethodInfo

The method info.

factory IMethodFactory

The factory to create an IMethod from the MethodInfo resolved by GenericMethod.

Properties

Factory

Gets information about the factory to create IMethod from MethodInfo.

public IMethodFactory Factory { get; }

Property Value

IMethodFactory

Method

Gets information about the method.

public MethodInfo Method { get; }

Property Value

MethodInfo

Parameters

Gets information about the parameters of the method.

public IEnumerable<ParameterInfo> Parameters { get; }

Property Value

IEnumerable<ParameterInfo>

Methods

Invoke(IEnumerable<object>)

Invokes the method with the supplied parameters.

public object Invoke(IEnumerable<object> parameters)

Parameters

parameters IEnumerable<object>

The parameters.

Returns

object

The result of the method call.