Class SpecimenFactory<TInput1, TInput2, TInput3, TInput4, T>
Creates a new specimen using a System.Func<T1, T2, T3, T4, TResult>.
Inheritance
Implements
Inherited Members
Namespace: AutoFixture.Kernel
Assembly: AutoFixture.dll
Syntax
public class SpecimenFactory<TInput1, TInput2, TInput3, TInput4, T> : ISpecimenBuilder
Type Parameters
Name | Description |
---|---|
TInput1 | The type of the first parameter provided to the Func. |
TInput2 | The type of the second parameter provided to the Func. |
TInput3 | The type of the third parameter provided to the Func. |
TInput4 | The type of the fourth parameter provided to the Func. |
T | The type of specimen to create. |
Constructors
| Improve this Doc View SourceSpecimenFactory(Func<TInput1, TInput2, TInput3, TInput4, T>)
Initializes a new instance of the SpecimenFactory<TInput1, TInput2, TInput3, TInput4, T> class.
Declaration
public SpecimenFactory(Func<TInput1, TInput2, TInput3, TInput4, T> factory)
Parameters
Type | Name | Description |
---|---|---|
System.Func<TInput1, TInput2, TInput3, TInput4, T> | factory | The func that will create specimens. |
Remarks
The input parameters to factory
will be supplied by the
ISpecimenContext passed to the Create(Object, ISpecimenContext) method.
Properties
| Improve this Doc View SourceFactory
Gets the factory that creates specimens.
Declaration
public Func<TInput1, TInput2, TInput3, TInput4, T> Factory { get; }
Property Value
Type | Description |
---|---|
System.Func<TInput1, TInput2, TInput3, TInput4, T> |
Methods
| Improve this Doc View SourceCreate(Object, ISpecimenContext)
Creates a new specimen based on a request.
Declaration
public object Create(object request, ISpecimenContext context)
Parameters
Type | Name | Description |
---|---|---|
System.Object | request | The request that describes what to create. |
ISpecimenContext | context | A context that can be used to create other specimens. |
Returns
Type | Description |
---|---|
System.Object | The specimen created by the Func contained by this instance. |
Remarks
request
is ignored. Instead, the Func contained by this instance is
used to create a specimen. The parameters for the Func is supplied by
context
.