Class RandomDateTimeSequenceGenerator
Creates random System.DateTime specimens.
Inheritance
System.Object
RandomDateTimeSequenceGenerator
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 RandomDateTimeSequenceGenerator : ISpecimenBuilder
Remarks
The generated System.DateTime values will be within a range of ± two years from today's date, unless a different range has been specified in the constructor.
Constructors
| Improve this Doc View SourceRandomDateTimeSequenceGenerator()
Initializes a new instance of the RandomDateTimeSequenceGenerator class.
Declaration
public RandomDateTimeSequenceGenerator()
RandomDateTimeSequenceGenerator(DateTime, DateTime)
Initializes a new instance of the RandomDateTimeSequenceGenerator class for a specific range of dates.
Declaration
public RandomDateTimeSequenceGenerator(DateTime minDate, DateTime maxDate)
Parameters
Type | Name | Description |
---|---|---|
System.DateTime | minDate | The lower bound of the date range. |
System.DateTime | maxDate | The upper bound of the date range. |
Exceptions
Type | Condition |
---|---|
System.ArgumentException |
|
Methods
| Improve this Doc View SourceCreate(Object, ISpecimenContext)
Creates a new System.DateTime specimen based on a request.
Declaration
public object Create(object request, ISpecimenContext context)
Parameters
Type | Name | Description |
---|---|---|
System.Object | request | The request that describes what to create. |
ISpecimenContext | context | Not used. |
Returns
Type | Description |
---|---|
System.Object | A new System.DateTime specimen, if |