Class ActionSpecimenCommand<T>
Adapts an action delegate to ISpecimenCommand.
Inheritance
System.Object
ActionSpecimenCommand<T>
Implements
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: AutoFixture.Kernel
Assembly: AutoFixture.dll
Syntax
public class ActionSpecimenCommand<T> : ISpecimenCommand
Type Parameters
Name | Description |
---|---|
T | The type of specimen operated on by the adapted action delegate. |
Constructors
| Improve this Doc View SourceActionSpecimenCommand(Action<T, ISpecimenContext>)
Initializes a new instance of the ActionSpecimenCommand<T> class.
Declaration
public ActionSpecimenCommand(Action<T, ISpecimenContext> action)
Parameters
Type | Name | Description |
---|---|---|
System.Action<T, ISpecimenContext> | action | An action to be performed when Execute(Object, ISpecimenContext) is invoked. |
See Also
| Improve this Doc View SourceActionSpecimenCommand(Action<T>)
Initializes a new instance of the ActionSpecimenCommand<T> class.
Declaration
public ActionSpecimenCommand(Action<T> action)
Parameters
Type | Name | Description |
---|---|---|
System.Action<T> | action | An action to be performed when Execute(Object, ISpecimenContext) is invoked. |
See Also
Methods
| Improve this Doc View SourceExecute(Object, ISpecimenContext)
Invokes the adapted action on the specimen.
Declaration
public void Execute(object specimen, ISpecimenContext context)
Parameters
Type | Name | Description |
---|---|---|
System.Object | specimen | The specimen on which to invoke the adapted action. |
ISpecimenContext | context | The context. |
Remarks
This method invokes the adapted action supplied via one of the
constructors, passing specimen
and
context
to the action.