Table of Contents

Class Generators.Temporal

Namespace
Hegel
Assembly
Hegel.dll

The date and time generators, under the names every Hegel frontend shares. The values they draw, and ZoneSource, are in the Hegel.Temporal namespace.

public static class Generators.Temporal
Inheritance
Generators.Temporal
Inherited Members

Methods

DateTimes()

Date-times without a time zone.

public static DateTimeGenerator DateTimes()

Returns

DateTimeGenerator

Remarks

Bad arguments are reported as Dates() describes.

Dates()

Dates, of any year from 1 to 9999 unless bounded.

public static DateGenerator Dates()

Returns

DateGenerator

Remarks

The temporal generators check their settings with the engine as each is given. A call that completes a conflict among the settings given so far throws an ArgumentException with the engine's message, whatever order they came in: Min(a).Max(b) and Max(b).Min(a) both throw at the second call when a is after b. A setting not yet given counts as unrestricted, not as its default, so a conflict with a default that a later call could still change is left to the first draw, which reports it as a HegelUsageException.

Durations()

Exact lengths of time of either sign, anywhere in TimeSpan's range unless bounded.

public static DurationGenerator Durations()

Returns

DurationGenerator

Remarks

Bad arguments are reported as Dates() describes.

Instants()

Instants: DateTimeOffsets with a zero offset, anywhere in that type's range unless bounded.

public static InstantGenerator Instants()

Returns

InstantGenerator

Remarks

Bad arguments are reported as Dates() describes.

Offsets()

UTC offsets: whole minutes between -14:00 and +14:00 unless the generator is told otherwise.

public static OffsetGenerator Offsets()

Returns

OffsetGenerator

Remarks

Bad arguments are reported as Dates() describes. A bound beyond the default range on its own (Offsets().Min(TimeSpan.FromHours(15))) conflicts only with the other bound's default, so it is the first draw that reports it.

Spans()

Calendar spans: a count of each unit from years to nanoseconds, all of one sign.

public static SpanGenerator Spans()

Returns

SpanGenerator

Remarks

Bad arguments are reported as Dates() describes. Unit bounds that conflict with the default sign policy are reported by the first draw, since Sign(SpanSign) could still change it.

Times()

Times of day, to the tick unless Precision(Precision) says otherwise.

public static TimeGenerator Times()

Returns

TimeGenerator

Remarks

Bad arguments are reported as Dates() describes.

ZonedDateTimes()

Date-times in time zones: a wall-clock time in a zone of Default, as it is now, with the offset and instant that zone gives it. Times the clocks skipped are not drawn unless AllowImaginary(bool) asks for them; repeated times are.

public static ZonedDateTimeGenerator ZonedDateTimes()

Returns

ZonedDateTimeGenerator

Remarks

Bad arguments are reported as Dates() describes, and what depends on the zone source as Zones() describes. A drawn value .NET cannot hold (an instant outside the years 1 to 9999, which a wall-clock time within hours of either end can name) rejects the test case.

Zones()

Time zones: those of Default, as it is now, that this system has a TimeZoneInfo for.

public static ZoneGenerator Zones()

Returns

ZoneGenerator

Remarks

Bad arguments are reported as Dates() describes. A name the zone source lacks is reported by a builder method only once Source(ZoneSource) has named the source, and otherwise by the first draw, since the source could still be changed. That AllowLinks(bool) and AllowLegacy(bool) leave none of the source's zones to draw is always reported by the first draw, since Names(params string[]), which they do not apply to, could still be called.