Class DateGenerator
Draws dates, shrinking toward 2000-01-01. See Dates() for how bad arguments are reported.
public sealed class DateGenerator : ValueGenerator<DateOnly>
- Inheritance
-
DateGenerator
- Inherited Members
Methods
DoDraw(TestCase)
Draw one value. Called inside a span labelled Label: draw from another generator through DrawSilent<T>(Generator<T>), which opens its span, rather than by calling its hook.
protected override DateOnly DoDraw(TestCase tc)
Parameters
tcTestCase
Returns
Max(DateOnly)
No later than max.
public DateGenerator Max(DateOnly max)
Parameters
maxDateOnly
Returns
Exceptions
- ArgumentException
The settings given so far allow no date.
Min(DateOnly)
No earlier than min.
public DateGenerator Min(DateOnly min)
Parameters
minDateOnly
Returns
Exceptions
- ArgumentException
The settings given so far allow no date.
Months(params int[])
Only dates in one of months, numbered from 1 for January.
public DateGenerator Months(params int[] months)
Parameters
monthsint[]
Returns
Exceptions
- ArgumentException
monthsis empty or holds a number that is no month, or the settings given so far allow no date.
Weekdays(params DayOfWeek[])
Only dates falling on one of days.
public DateGenerator Weekdays(params DayOfWeek[] days)
Parameters
daysDayOfWeek[]
Returns
Exceptions
- ArgumentException
daysis empty or holds a value that is no day, or the settings given so far allow no date.