Class SeedIgnoringRelay
Unwraps a request for a SeededRequest to a request for its Request while ignoring the Seed.
Inheritance
Implements
Inherited Members
Namespace: AutoFixture.Kernel
Assembly: AutoFixture.dll
Syntax
public class SeedIgnoringRelay : ISpecimenBuilder
Methods
| Improve this Doc View SourceCreate(Object, ISpecimenContext)
Creates an anonymous value by unwrapping a seeded request and ignoring the seed.
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 | A specimen based on |
Remarks
If request
is a seeded request, the Create method unwraps the inner
request and forwards it to context
. The seed value is ignored.
The purpose of this class is to provide a fallback to handle seeded requests that no other ISpecimenBuilder instances have been able to handle. By ignoring the seed value, it handles those scenarios where the seed value and the inner request don't match and can't be combined, ensuring that at least some value is returned.