Class NumericSequencePerTypeCustomization
A customization that enables numeric specimens to be unique within a specific numeric System.Type.
Inheritance
Implements
Inherited Members
Namespace: AutoFixture
Assembly: AutoFixture.dll
Syntax
public class NumericSequencePerTypeCustomization : ICustomization
Remarks
When this customization is added to an IFixture instance, requests for numeric specimens will be satisfied by returning numbers from a System.Type specific sequence.
This customization reproduces the generation strategy for numeric specimens used in AutoFixture up to version 2.1.
var fixture = new Fixture();
fixture.Customize(new NumericSequencePerTypeCustomization());
Console.WriteLine("Byte specimen is {0}", fixture.Create<byte>());
Console.WriteLine("Int32 specimen is {0}", fixture.Create<int>());
Console.WriteLine("Single specimen is {0}", fixture.Create<float>());
// The output of this program will be:
// Byte specimen is 1
// Int32 specimen is 1
// Single specimen is 1
Methods
| Improve this Doc View SourceCustomize(IFixture)
Customizes the specified fixture by adding the System.Type specific numeric sequence generators.
Declaration
public void Customize(IFixture fixture)
Parameters
Type | Name | Description |
---|---|---|
IFixture | fixture | The fixture to customize. |