JustDummies

Juste des dummies, mais redoutablement efficaces.

API v1.0.0-preview.6

Sections de l'API

Inspection de pool

Ce que les contraintes déclarées d'un générateur laissent d'un ensemble de valeurs que vous avez fourni vous-même — celles encore tirables, et celles refusées, chacune nommant la contrainte qui l'a refusée.

Les signatures et les commentaires de documentation ci-dessous restent en anglais sur toutes les pages, dans toutes les locales : ils sont lus directement dans les paquets publiés, et non écrits pour ce site.

sealed class

DeclaredConstraint

A constraint as the caller declared it, in the form a reader recognizes from the diagnostics — WithMinLength(2), Numeric(), Except(...). It is what a PoolRejection names to say why a supplied value never draws, so the reason travels as a value that can be compared and filtered rather than as text that would have to be parsed back (ADR-0042).

public sealed class DeclaredConstraint
Implémente
IEquatable<DeclaredConstraint>

Propriétés

string Arguments { get; }The arguments the declaring generator rendered, or ... when it could not render them.
string Name { get; }The declaring method's name, such as WithMinLength.

Méthodes

string ToString()Returns the constraint as the caller spelled it. Total by construction: the text was built when the constraint was declared, so quoting one cannot fail.
bool Equals(DeclaredConstraint? other)
bool Equals(object? obj)
int GetHashCode()

interface

IPoolInspection<T>

What a generator's declared constraints left of a caller-supplied value set: the values still drawable, and the ones the constraints refuse together with the constraint that refuses each. It answers the question a narrowed catalogue leaves open — widen the invariant, or fix the catalogue? — and it is reached by an explicit cast, never from the fluent surface (ADR-0067).

public interface IPoolInspection<T>

Propriétés

bool IsPooled { get; }Whether a value set is in force — false for a generator that builds its value rather than picking it from supplied values, which has a pool neither to keep nor to reject from.

Méthodes

IReadOnlyList<T?> GetSurvivors()The supplied values that satisfy every declared constraint — the exact domain a draw picks from, in the order they were supplied, with duplicates already collapsed. Empty when IsPooled is false; never empty otherwise, since a value set left with nothing is refused at declaration.
IReadOnlyList<PoolRejection<T?>> GetRejections()The supplied values no draw can ever yield, each with the declared constraints that refuse it. Empty when IsPooled is false, and empty when every supplied value survived — which is what a catalogue in step with its invariants looks like.

sealed class

PoolRejection<T>

One value a caller supplied to a generator's pool that the declared constraints refuse, together with the constraints that refuse it. It is what tells the two repairs apart when part of a catalogue never draws: the value points at the catalogue, the constraints point at the invariant (ADR-0067).

public sealed class PoolRejection<T>
Implémente
IEquatable<PoolRejection<T>>

Propriétés

IReadOnlyList<DeclaredConstraint> RejectedBy { get; }The declared constraints this value fails, in a stable order.
T? Value { get; }The value the caller supplied, which the generator can never draw as constrained.

Méthodes

string ToString()Renders the rejection for a reader: the value, then the constraints that refuse it.
bool Equals(PoolRejection<T?>? other)
bool Equals(object? obj)
int GetHashCode()