Table of Contents

Class DateTimeGenerator

Namespace
Hegel.Temporal
Assembly
Hegel.dll

Draws date-times without a time zone (Unspecified), shrinking toward 2000-01-01T00:00. See Dates() for how bad arguments are reported.

public sealed class DateTimeGenerator : ValueGenerator<DateTime>
Inheritance
DateTimeGenerator
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 DateTime DoDraw(TestCase tc)

Parameters

tc TestCase

Returns

DateTime

Max(DateTime)

No later than max.

public DateTimeGenerator Max(DateTime max)

Parameters

max DateTime

Returns

DateTimeGenerator

Exceptions

ArgumentException

The settings given so far allow no date-time.

Min(DateTime)

No earlier than min.

public DateTimeGenerator Min(DateTime min)

Parameters

min DateTime

Returns

DateTimeGenerator

Exceptions

ArgumentException

The settings given so far allow no date-time.

Precision(Precision)

Only times of day that are whole numbers of precision since midnight, rather than of ticks.

public DateTimeGenerator Precision(Precision precision)

Parameters

precision Precision

Returns

DateTimeGenerator

Exceptions

ArgumentException

precision is not a precision, or the settings given so far allow no date-time.

WithOffsets(Generator<TimeSpan>)

These date-times paired with offsets from offsets, as DateTimeOffsets.

public PrintableGenerator<DateTimeOffset> WithOffsets(Generator<TimeSpan> offsets)

Parameters

offsets Generator<TimeSpan>

Returns

PrintableGenerator<DateTimeOffset>

WithTimeZones(Generator<TimeZoneInfo>)

These date-times read as local times in zones from zones, as DateTimeOffsets (a zone's historical offset with seconds is truncated to minutes).

[Obsolete("Use Generators.Temporal.ZonedDateTimes().Zones(zones), whose values say which zone they are in and whether the wall-clock time was skipped or repeated; ZonedDateTime.ToDateTimeOffset() gives the DateTimeOffset.")]
public PrintableGenerator<DateTimeOffset> WithTimeZones(Generator<TimeZoneInfo> zones)

Parameters

zones Generator<TimeZoneInfo>

Returns

PrintableGenerator<DateTimeOffset>