Class StableFiniteSequenceRelay
Unwraps a request for many instances and returns the results as a stable list.
Inheritance
Implements
Inherited Members
Namespace: AutoFixture.Kernel
Assembly: AutoFixture.dll
Syntax
public class StableFiniteSequenceRelay : ISpecimenBuilder
Remarks
In contrast to FiniteSequenceRelay this alternative implementation returns the sequence wrapped in a System.Collections.Generic.List`1. This means that the iterator will yield the same instances across multiple iterations.
By default this class is not used by Fixture, but it can be used to override the dynamic enumerable behavior by adding it to Customizations.
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 | Many specimens if |
Remarks
The sequence of specimens returned is stable which means that it can be iterated over more than once and be expected to yield the same instances every time.