Table of Contents

Interface IGeneratorContext

Namespace
Conjecture.Core
Assembly
Conjecture.Core.dll

Provides imperative draw and assume operations within a Generate.Compose factory.

public interface IGeneratorContext

Methods

Assume(bool)

Rejects the current test case if condition is false.

void Assume(bool condition)

Parameters

condition bool

Generate<T>(Strategy<T>)

Generates a value from strategy.

T Generate<T>(Strategy<T> strategy)

Parameters

strategy Strategy<T>

Returns

T

Type Parameters

T

Target(double, string)

Records a numeric observation to guide targeted generation.

void Target(double observation, string label = "default")

Parameters

observation double

The value to maximize. Must be finite (not NaN or Infinity).

label string

Identifies this metric. Multiple labels are optimized independently.