Class ModestConstructorQuery

Namespace: AutoFixture.Kernel
Assembly: AutoFixture.dll

Selects public constructors ordered by the most modest constructor first.

public class ModestConstructorQuery : IMethodQuery

Inheritance

objectModestConstructorQuery

Implements

IMethodQuery

Inherited Members

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

Constructors

ModestConstructorQuery()

public ModestConstructorQuery()

Methods

SelectMethods(Type)

Selects the constructors for the supplied type.

public IEnumerable<IMethod> SelectMethods(Type type)

Parameters

type Type

The type.

Returns

IEnumerable<IMethod>

All public constructors for type, ordered by the most modest constructor first.

Remarks

The ordering of the returned constructors is based on the number of parameters of the constructor. Constructors with fewer parameters are returned before constructors with more parameters. This means that if a default constructor exists, it will be the first one returned.

In case of two constructors with an equal number of parameters, the ordering is unspecified.