Class ActionSpecimenCommand<T>

Namespace: AutoFixture.Kernel
Assembly: AutoFixture.dll

Adapts an action delegate to ISpecimenCommand.

public class ActionSpecimenCommand<T> : ISpecimenCommand

Type Parameters

T

The type of specimen operated on by the adapted action delegate.

Inheritance

objectActionSpecimenCommand<T>

Implements

ISpecimenCommand

Inherited Members

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

Constructors

ActionSpecimenCommand(Action<T>)

Initializes a new instance of the ActionSpecimenCommand%601 class.

public ActionSpecimenCommand(Action<T> action)

Parameters

action Action<T>

An action to be performed when ISpecimenContext) is invoked.

See Also

ActionSpecimenCommand<T>.ActionSpecimenCommand(Action<T, ISpecimenContext>)

ActionSpecimenCommand(Action<T, ISpecimenContext>)

Initializes a new instance of the ActionSpecimenCommand%601 class.

public ActionSpecimenCommand(Action<T, ISpecimenContext> action)

Parameters

action Action<T, ISpecimenContext>

An action to be performed when ISpecimenContext) is invoked.

See Also

ActionSpecimenCommand<T>.ActionSpecimenCommand(Action<T>)

Methods

Execute(object, ISpecimenContext)

Invokes the adapted action on the specimen.

public void Execute(object specimen, ISpecimenContext context)

Parameters

specimen object

The specimen on which to invoke the adapted action.

context ISpecimenContext

The context.

Remarks

This method invokes the adapted action supplied via one of the constructors, passing specimen and context to the action.

See Also

ActionSpecimenCommand<T>.ActionSpecimenCommand(Action<T>), ActionSpecimenCommand<T>.ActionSpecimenCommand(Action<T, ISpecimenContext>)