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
TThe type of value drawn.
- Inheritance
-
Generator<T>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
tcTestCase
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
Returns
- T