Class RandomRangedNumberGenerator
Creates a random sequence for a given type within a given range without repeating in the range until all values are exhausted. Once exhausted, will automatically reset the set and continue choosing randomly within the range. Multiple requests (whether the same or different object) for the same operand type, minimum, and maximum are treated as being drawn from the same set.
Inheritance
Implements
Inherited Members
Namespace: AutoFixture
Assembly: AutoFixture.dll
Syntax
public class RandomRangedNumberGenerator : ISpecimenBuilder
Constructors
| Improve this Doc View SourceRandomRangedNumberGenerator()
Initializes a new instance of the RandomRangedNumberGenerator class.
Declaration
public RandomRangedNumberGenerator()
Methods
| Improve this Doc View SourceCreate(Object, ISpecimenContext)
Creates a random number within the request range.
Declaration
public object Create(object request, ISpecimenContext context)
Parameters
Type | Name | Description |
---|---|---|
System.Object | request | The request that describes what to create. Other requests for same type and limits denote the same set. |
ISpecimenContext | context | A context that can be used to create other specimens. |
Returns
Type | Description |
---|---|
System.Object | The next random number in a range |