Table of Contents

Class PrintableGenerator<T>

Namespace
Hegel
Assembly
Hegel.dll

A Generator<T> that prints each value as it draws it, so a failing test case's draws can be shown as the code that rebuilds them. Only printable generators can be drawn with Draw<T>(Generator<T>, string?).

public abstract class PrintableGenerator<T> : Generator<T>

Type Parameters

T

The type of value drawn.

Inheritance
PrintableGenerator<T>
Derived
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 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 abstract T DoDrawAndPrint(TestCase tc, Printer printer)

Parameters

tc TestCase
printer Printer

Returns

T