Class MapCreateManyToEnumerable
Maps a call to CreateMany<T>(ISpecimenBuilder) to a call for System.Collections.Generic.IEnumerable<T>.
Inheritance
System.Object
MapCreateManyToEnumerable
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
Assembly: AutoFixture.dll
Syntax
[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 : ICustomization
Remarks
Normally, CreateMany<T>(ISpecimenBuilder) returns its own implementation of System.Collections.Generic.IEnumerable<T>, 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.
Methods
| Improve this Doc View SourceCustomize(IFixture)
Customizes the specified fixture.
Declaration
public void Customize(IFixture fixture)
Parameters
Type | Name | Description |
---|---|---|
IFixture | fixture | The fixture to customize. |
Remarks
Customizes a IFixture so that CreateMany<T>(ISpecimenBuilder) exhibits the same behavior as a request to create System.Collections.Generic.IEnumerable<T>.
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | fixture is null. |