Class MapCreateManyToEnumerable
Namespace: AutoFixture
Assembly: AutoFixture.dll
Maps a call to
ISpecimenBuilder) to a
call for IEnumerable%601.
[Obsolete("This relay is obsolete and will be removed in future versions. The reason is that it causes recursion overflow for \"many\" requests if you forget to add IEnumerable<T> customization.\nPlease use the following code snippet instead:\nfixture.Customizations.Add( new FilteringSpecimenBuilder( new FixedBuilder( SEQUENCE_TO_RETURN), new EqualRequestSpecification( new MultipleRequest( new SeededRequest( typeof(T), default(T))))));\n\nIf you need that often, please create an extension method inside your project.")]
public class MapCreateManyToEnumerable : ICustomizationInheritance
object ← MapCreateManyToEnumerable
Implements
Inherited Members
object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
Remarks
Normally, `ISpecimenBuilder)` returns its own implementation of `IEnumerable%601`, even if other customizations have changed how IEnumerable<T> are handled. This ensures that CreateMany<T> still returns many instances, even when IEnumerable<T> have been changed to return an empty sequence.
If you want to change this default behavior, you can use this customization.
Constructors
MapCreateManyToEnumerable()
public MapCreateManyToEnumerable()Methods
Customize(IFixture)
Customizes the specified fixture.
public void Customize(IFixture fixture)Parameters
fixture IFixture
The fixture to customize.
Remarks
Customizes a `IFixture` so that `ISpecimenBuilder)` exhibits the same behavior as a request to create `IEnumerable%601`.
Exceptions
fixture is null.