Class MapGenerator<TKey, TValue>
- Namespace
- Hegel
- Assembly
- Hegel.dll
Draws dictionaries from key and value generators.
public sealed class MapGenerator<TKey, TValue> : PrintableGenerator<Dictionary<TKey, TValue>> where TKey : notnull
Type Parameters
TKeyTValue
- Inheritance
-
Generator<Dictionary<TKey, TValue>>PrintableGenerator<Dictionary<TKey, TValue>>MapGenerator<TKey, TValue>
- 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
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 Dictionary<TKey, TValue> DoDraw(TestCase tc)
Parameters
tcTestCase
Returns
- Dictionary<TKey, TValue>
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 Dictionary<TKey, TValue> DoDrawAndPrint(TestCase tc, Printer printer)
Parameters
Returns
- Dictionary<TKey, TValue>
MaxSize(int)
At most maxSize entries.
public MapGenerator<TKey, TValue> MaxSize(int maxSize)
Parameters
maxSizeint
Returns
- MapGenerator<TKey, TValue>
MinSize(int)
At least minSize entries.
public MapGenerator<TKey, TValue> MinSize(int minSize)
Parameters
minSizeint
Returns
- MapGenerator<TKey, TValue>