Class FilteredGenerator<T>
- Namespace
- Hegel
- Assembly
- Hegel.dll
A generator that draws from another until a predicate accepts the value.
public sealed class FilteredGenerator<T> : PrintableGenerator<T>
Type Parameters
T
- Inheritance
-
Generator<T>FilteredGenerator<T>
- Inherited Members
Fields
Attempts
How many values are tried before the test case is rejected.
public const int Attempts = 3
Field Value
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
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 override T DoDrawAndPrint(TestCase tc, Printer printer)
Parameters
Returns
- T