Table of Contents

Class DurationGenerator

Namespace
Hegel.Temporal
Assembly
Hegel.dll

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

tc TestCase

Returns

TimeSpan

Max(TimeSpan)

At most max.

public DurationGenerator Max(TimeSpan max)

Parameters

max TimeSpan

Returns

DurationGenerator

Exceptions

ArgumentException

The settings given so far allow no duration.

Min(TimeSpan)

At least min.

public DurationGenerator Min(TimeSpan min)

Parameters

min TimeSpan

Returns

DurationGenerator

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

precision Precision

Returns

DurationGenerator

Exceptions

ArgumentException

precision is not a precision, or the settings given so far allow no duration.