Class ConstructorMethod

Namespace: AutoFixture.Kernel
Assembly: AutoFixture.dll

Encapsulates a constructor as a method.

public class ConstructorMethod : IMethod, IEquatable<ConstructorMethod>

Inheritance

objectConstructorMethod

Implements

IMethod, IEquatable<ConstructorMethod>

Inherited Members

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

Constructors

ConstructorMethod(ConstructorInfo)

Initializes a new instance of the ConstructorMethod class.

public ConstructorMethod(ConstructorInfo constructor)

Parameters

constructor ConstructorInfo

The constructor.

Properties

Constructor

Gets the constructor.

public ConstructorInfo Constructor { get; }

Property Value

ConstructorInfo

Parameters

Gets information about the parameters of the method.

public IEnumerable<ParameterInfo> Parameters { get; }

Property Value

IEnumerable<ParameterInfo>

Methods

Equals(object)

Determines whether the specified Object is equal to this instance.

public override bool Equals(object obj)

Parameters

obj object

The Object to compare with this instance.

Returns

bool

true if the specified Object is equal to this instance; otherwise, false.

Equals(ConstructorMethod)

Indicates whether the current object is equal to another object of the same type.

public bool Equals(ConstructorMethod other)

Parameters

other ConstructorMethod

An object to compare with this object.

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

GetHashCode()

Returns a hash code for this instance.

public override int GetHashCode()

Returns

int

A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.

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.