Class InstanceMethodQuery

Namespace: AutoFixture.Kernel
Assembly: AutoFixture.dll

Selects a method from an instance.

public class InstanceMethodQuery : IMethodQuery

Inheritance

objectInstanceMethodQuery

Implements

IMethodQuery

Inherited Members

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

Constructors

InstanceMethodQuery(object, string)

Constructs an instance of an InstanceMethodQuery, used to select a particular method from an instance.

public InstanceMethodQuery(object owner, string methodName)

Parameters

owner object

The instance that should be selected from.

methodName string

The name of the method that should be selected.

Properties

MethodName

Gets the name of the method that should be selected.

public string MethodName { get; }

Property Value

string

Owner

Gets the instance that should be selected from.

public object Owner { get; }

Property Value

object

Methods

SelectMethods(Type)

Selects MethodName from Owner.

public IEnumerable<IMethod> SelectMethods(Type type = null)

Parameters

type Type

Discarded.

Returns

IEnumerable<IMethod>

Returns an empty enumerable if MethodName does not belong to Owner; returns an enumerable containing a single InstanceMethod otherwise.