Table of Contents

Class ArrayGenerator<T>

Namespace
Hegel
Assembly
Hegel.dll

Draws arrays of values from an element generator.

public sealed class ArrayGenerator<T> : PrintableGenerator<T[]>

Type Parameters

T
Inheritance
ArrayGenerator<T>
Inherited Members

Properties

Label

The span label the engine files this generator's draws under. Defaults to a label derived from the class's full name.

public override ulong Label { get; }

Property Value

ulong

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 T[] DoDraw(TestCase tc)

Parameters

tc TestCase

Returns

T[]

DoDrawAndPrint(TestCase, Printer)

Draw one value, printing it to printer (which may be Noop). Draw its parts through DrawAndPrint<T>(Generator<T>, Printer).

protected override T[] DoDrawAndPrint(TestCase tc, Printer printer)

Parameters

tc TestCase
printer Printer

Returns

T[]

MaxSize(int)

At most maxSize elements.

public ArrayGenerator<T> MaxSize(int maxSize)

Parameters

maxSize int

Returns

ArrayGenerator<T>

MinSize(int)

At least minSize elements.

public ArrayGenerator<T> MinSize(int minSize)

Parameters

minSize int

Returns

ArrayGenerator<T>

Unique()

No two equal elements.

public ArrayGenerator<T> Unique()

Returns

ArrayGenerator<T>

UniqueBy(Func<T, object?>)

No two elements with equal keys.

public ArrayGenerator<T> UniqueBy(Func<T, object?> key)

Parameters

key Func<T, object>

Returns

ArrayGenerator<T>