Class FixedBuilder
A ISpecimenBuilder that always returns the same specimen.
Inheritance
System.Object
FixedBuilder
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 FixedBuilder : ISpecimenBuilder
Constructors
| Improve this Doc View SourceFixedBuilder(Object)
Initializes a new instance of the FixedBuilder class.
Declaration
public FixedBuilder(object specimen)
Parameters
Type | Name | Description |
---|---|---|
System.Object | specimen | The specimen to return from the Create(Object, ISpecimenContext) method. |
Methods
| Improve this Doc View SourceCreate(Object, ISpecimenContext)
Returns the same specimen every time.
Declaration
public object Create(object request, ISpecimenContext context)
Parameters
Type | Name | Description |
---|---|---|
System.Object | request | The request that describes what to create. Ignored. |
ISpecimenContext | context | A context that can be used to create other specimens. Ignored. |
Returns
Type | Description |
---|---|
System.Object | The specimen supplied to the instance in the constructor. |