Table of Contents

Interface IGenerationContext

Namespace
Conjecture.Core
Assembly
Conjecture.Core.dll

Provides imperative generation and assumption operations within a Strategy.Compose body.

public interface IGenerationContext

Methods

Assume(bool)

Rejects the current example 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 observation label. Multiple labels are targeted independently.