Class DurationGenerator
Draws exact lengths of time, as TimeSpans of either sign, shrinking toward zero. See Dates() for how bad arguments are reported.
public sealed class DurationGenerator : ValueGenerator<TimeSpan>
- Inheritance
-
DurationGenerator
- 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 TimeSpan DoDraw(TestCase tc)
Parameters
tcTestCase
Returns
Max(TimeSpan)
At most max.
public DurationGenerator Max(TimeSpan max)
Parameters
maxTimeSpan
Returns
Exceptions
- ArgumentException
The settings given so far allow no duration.
Min(TimeSpan)
At least min.
public DurationGenerator Min(TimeSpan min)
Parameters
minTimeSpan
Returns
Exceptions
- ArgumentException
The settings given so far allow no duration.
Precision(Precision)
Only whole numbers of precision, rather than of ticks.
public DurationGenerator Precision(Precision precision)
Parameters
precisionPrecision
Returns
Exceptions
- ArgumentException
precisionis not a precision, or the settings given so far allow no duration.