Table of Contents

Class SampleGenerator<T>

Namespace
Hegel
Assembly
Hegel.dll

Draws samples of a sequence: some of its elements in any order, with or without replacement.

public sealed class SampleGenerator<T> : ValueGenerator<List<T>>

Type Parameters

T
Inheritance
SampleGenerator<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 List<T> DoDraw(TestCase tc)

Parameters

tc TestCase

Returns

List<T>

MaxSize(int)

At most maxSize elements.

public SampleGenerator<T> MaxSize(int maxSize)

Parameters

maxSize int

Returns

SampleGenerator<T>

MinSize(int)

At least minSize elements.

public SampleGenerator<T> MinSize(int minSize)

Parameters

minSize int

Returns

SampleGenerator<T>

WithReplacement()

Elements may repeat (the default).

public SampleGenerator<T> WithReplacement()

Returns

SampleGenerator<T>

WithoutReplacement()

Each element appears at most once.

public SampleGenerator<T> WithoutReplacement()

Returns

SampleGenerator<T>