Class RandomNumericSequenceGenerator
Creates a sequence of random, unique, numbers starting at 1.
Inheritance
System.Object
RandomNumericSequenceGenerator
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
public class RandomNumericSequenceGenerator : ISpecimenBuilder
Constructors
| Improve this Doc View SourceRandomNumericSequenceGenerator()
Initializes a new instance of the RandomNumericSequenceGenerator class with the default limits, 255, 32767, and 2147483647.
Declaration
public RandomNumericSequenceGenerator()
RandomNumericSequenceGenerator(IEnumerable<Int64>)
Initializes a new instance of the RandomNumericSequenceGenerator class.
Declaration
public RandomNumericSequenceGenerator(IEnumerable<long> limits)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<System.Int64> | limits | A sequence of at least two ascending numbers. |
RandomNumericSequenceGenerator(Int64[])
Initializes a new instance of the RandomNumericSequenceGenerator class.
Declaration
public RandomNumericSequenceGenerator(params long[] limits)
Parameters
Type | Name | Description |
---|---|---|
System.Int64[] | limits | An array of at least two ascending numbers. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | |
System.ArgumentException |
Properties
| Improve this Doc View SourceLimits
Gets the sequence of limits.
Declaration
public IEnumerable<long> Limits { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<System.Int64> | The sequence of limits. |
Methods
| Improve this Doc View SourceCreate(Object, ISpecimenContext)
Creates an anonymous number.
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 | The next random number in a sequence, if |