Table of Contents

Class OffsetGenerator

Namespace
Hegel.Temporal
Assembly
Hegel.dll

Draws UTC offsets, as TimeSpans east of UTC, shrinking toward zero: whole minutes between -14:00 and +14:00 by default, which is what a DateTimeOffset can hold. See Dates() for how bad arguments are reported.

public sealed class OffsetGenerator : ValueGenerator<TimeSpan>
Inheritance
OffsetGenerator
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

Granularity(OffsetGranularity)

Only whole numbers of granularity, rather than of minutes.

public OffsetGenerator Granularity(OffsetGranularity granularity)

Parameters

granularity OffsetGranularity

Returns

OffsetGenerator

Exceptions

ArgumentException

granularity is not a granularity, or the settings given so far allow no offset.

Max(TimeSpan)

At most max, which may be as high as +25:59:59. The lower bound stays -14:00 unless Min(TimeSpan) changes it.

public OffsetGenerator Max(TimeSpan max)

Parameters

max TimeSpan

Returns

OffsetGenerator

Exceptions

ArgumentException

max is not a whole number of seconds, or the settings given so far allow no offset.

Min(TimeSpan)

At least min, which may be as low as -25:59:59. The upper bound stays +14:00 unless Max(TimeSpan) changes it.

public OffsetGenerator Min(TimeSpan min)

Parameters

min TimeSpan

Returns

OffsetGenerator

Exceptions

ArgumentException

min is not a whole number of seconds, or the settings given so far allow no offset.