JustDummies

Just dummies — but seriously powerful ones.

API v1.0.0-preview.6

API sections

Primitive generators

The basic generators: one fluent constraint at a time, and nothing drawn until Generate is called.

sealed class

AnyBoolean

A fluent generator of arbitrary Boolean values. True() and False() pin the value — mostly useful for symmetry when a test sweeps cases — and contradictory pins fail eagerly with a ConflictingAnyConstraintException naming both sides, like every other generator.

public sealed class AnyBoolean
Implements
IAny<bool>

Constructed via

static AnyBoolean Any.Boolean()Starts an arbitrary Boolean generator drawing from the ambient random context — an even coin flip unless pinned with True() or False().

Methods

AnyBoolean True()Pins the value to true.
AnyBoolean False()Pins the value to false.
AnyBoolean DifferentFrom(bool value)Requires the value to differ from value — which, for a boolean, pins it to the opposite. The name carries the intent at the call site.
bool Generate()Produces one arbitrary value satisfying every constraint declared on this generator.

sealed class

AnyByte

A fluent generator of arbitrary Byte values — the same contract as AnyInt32: constraints express what the surrounding code requires of the value, never what the test asserts; contradictory constraints fail eagerly with a ConflictingAnyConstraintException naming both sides; instances are immutable recipes, and each value is built to satisfy the constraints in one draw.

public sealed class AnyByte
Implements
IAny<byte>, IPoolInspection<byte>

Constructed via

static AnyByte Any.Byte()Starts an arbitrary Byte generator drawing from the ambient random context: full range unless constrained. Same constraint algebra as AnyInt32, less Positive() and Negative(), which an unsigned type cannot express.

Methods

AnyByte Zero()Pins the value to exactly zero. Useful for symmetry with the other constraints when a test sweeps cases.
AnyByte NonZero()Requires a value different from zero.
AnyByte GreaterThan(byte value)Requires a value strictly greater than value.
AnyByte GreaterThanOrEqualTo(byte value)Requires a value greater than or equal to value.
AnyByte LessThan(byte value)Requires a value strictly less than value.
AnyByte LessThanOrEqualTo(byte value)Requires a value less than or equal to value.
AnyByte Between(byte minimum, byte maximum)Requires a value within the inclusive range [minimum, maximum].
AnyByte MultipleOf(byte value)Requires the value to be a multiple of value — drawn directly on that lattice, so the declared range keeps its meaning (unlike a post-hoc As(x => x * k) projection). Declared once per generator.
AnyByte OneOf(params byte[] values)Requires the value to be one of the supplied values. Declared once per generator.
AnyByte Except(params byte[] values)Requires the value to be none of the supplied values.
AnyByte DifferentFrom(byte value)Requires the value to differ from value — typically an existing value the test already holds. Semantically equivalent to Except; the name carries the intent at the call site.
byte Generate()Produces one arbitrary value satisfying every constraint declared on this generator.

sealed class

AnyChar

A fluent generator of arbitrary Char values. Unconstrained, it draws from the whole of ASCII — 0x00 to 0x7F, control characters included — and every constraint narrows that set, with no exception (ADR-0075). A dummy that can be a carriage return or a NUL is what makes an unconstrained draw worth something: the code under test had no say in it, so what it survives, it has been shown to tolerate. Declare the invariant the surrounding code actually has and the draw respects it.

public sealed class AnyChar
Implements
IAny<char>, IPoolInspection<char>

Constructed via

static AnyChar Any.Char()Starts an arbitrary Char generator drawing from the ambient random context — the whole of ASCII, control characters included, unless constrained (ADR-0075), mirroring AnyString's character families.

Methods

AnyChar Alpha()Restricts the character to ASCII letters only. Declared once per generator.
AnyChar Numeric()Restricts the character to ASCII digits only. Declared once per generator.
AnyChar AlphaNumeric()Restricts the character to ASCII letters and digits only. Declared once per generator.
AnyChar Punctuation()Restricts the character to ASCII punctuation — the 32 printable characters that are neither a letter, a digit nor the space, POSIX [:punct:]. The family to declare when the surrounding code requires a character it must not read as alphanumeric: a separator, a delimiter, an operator. Broader than IsPunctuation, which classifies +, < and $ as symbols rather than punctuation — assert on the invariant the code actually has, not on that predicate. Declared once per generator.
AnyChar Printable()Restricts the character to printable ASCII — every character from the space (0x20) to ~ (0x7E). The family to declare when the surrounding code cannot take a control character: an unconstrained draw spans the whole of ASCII, so a carriage return or a NUL is exactly what it may hand you, and saying so here is what a length or a format invariant does elsewhere. Declared once per generator.
AnyChar NonPrintable()Restricts the character to the ASCII characters that are not printable — the 33 C0 controls and DEL. The family to declare when the code under test is meant to reject or strip them, so the counter-example is drawn rather than hand-listed. Declared once per generator.
AnyChar Whitespaces()Restricts the character to ASCII whitespace — the space and the tab, the readable pair the regex generator already draws \s from. Declared once per generator.
AnyChar Hexadecimal()Restricts the character to the base-16 alphabet of RFC 4648 — 0-9, A-F and a-f. Chain InLowerCase or InUpperCase for the single-case form a hash or a colour usually requires. Declared once per generator.
AnyChar WithoutAlpha()Removes the ASCII letters from whatever the generator would otherwise draw. Unlike a family, a subtraction does not occupy the one family slot and several accumulate, so WithoutAlpha().WithoutNumeric() leaves the punctuation, the whitespace and the controls.
AnyChar WithoutNumeric()Removes the ASCII digits from whatever the generator would otherwise draw. Accumulates with WithoutAlpha rather than replacing it.
AnyChar InLowerCase()Requires an alphabetic character to be lowercase. Declared once per generator.
AnyChar InUpperCase()Requires an alphabetic character to be uppercase. Declared once per generator.
AnyChar OneOf(params char[] values)Requires the character to be one of the supplied values. Declared once per generator.
AnyChar Except(params char[] values)Requires the character to be none of the supplied values.
AnyChar DifferentFrom(char value)Requires the character to differ from value — typically an existing value the test already holds. Semantically equivalent to Except; the name carries the intent at the call site.
char Generate()Produces one arbitrary value satisfying every constraint declared on this generator.

sealed class

AnyDateOnly

A fluent generator of arbitrary DateOnly values — the same contract as AnyInt32: constraints express what the surrounding code requires of the value, never what the test asserts; contradictory constraints fail eagerly with a ConflictingAnyConstraintException naming both sides; instances are immutable recipes, and each value is built to satisfy the constraints in one draw. Available on the net8.0 target only, like the type itself. There is deliberately no clock-relative constraint: a reproducible test pins its reference dates explicitly with After and Before.

public sealed class AnyDateOnly
Implements
IAny<DateOnly>, IPoolInspection<DateOnly>

Constructed via

static AnyDateOnly Any.DateOnly()Starts an arbitrary DateOnly generator drawing from the ambient random context — any representable date unless constrained. Net8.0 target only, like the type itself.

Methods

AnyDateOnly After(DateOnly date)Requires a date strictly after date.
AnyDateOnly AfterOrEqualTo(DateOnly date)Requires a date at or after date.
AnyDateOnly Before(DateOnly date)Requires a date strictly before date.
AnyDateOnly BeforeOrEqualTo(DateOnly date)Requires a date at or before date.
AnyDateOnly Between(DateOnly start, DateOnly end)Requires a date within the inclusive range [start, end].
AnyDateOnly OneOf(params DateOnly[] values)Requires the date to be one of the supplied values. Declared once per generator.
AnyDateOnly Except(params DateOnly[] values)Requires the date to be none of the supplied values.
AnyDateOnly DifferentFrom(DateOnly value)Requires the date to differ from value — typically an existing value the test already holds. Semantically equivalent to Except; the name carries the intent at the call site.
DateOnly Generate()Produces one arbitrary value satisfying every constraint declared on this generator.

sealed class

AnyDateTime

A fluent generator of arbitrary DateTime values — the same contract as AnyInt32: constraints express what the surrounding code requires of the value, never what the test asserts; contradictory constraints fail eagerly with a ConflictingAnyConstraintException naming both sides; instances are immutable recipes, and each value is built to satisfy the constraints in one draw.

public sealed class AnyDateTime
Implements
IAny<DateTime>, IPoolInspection<DateTime>

Constructed via

static AnyDateTime Any.DateTime()Starts an arbitrary DateTime generator drawing from the ambient random context: any representable instant unless constrained; generated values carry Utc kind. Same constraint algebra as AnyInt32 with the bounds renamed After(...)/Before(...): no sign or zero constraint, no MultipleOf(...), plus WithGranularity(...).

Methods

AnyDateTime After(DateTime instant)Requires an instant strictly after instant.
AnyDateTime AfterOrEqualTo(DateTime instant)Requires an instant at or after instant.
AnyDateTime Before(DateTime instant)Requires an instant strictly before instant.
AnyDateTime BeforeOrEqualTo(DateTime instant)Requires an instant at or before instant.
AnyDateTime Between(DateTime start, DateTime end)Requires an instant within the inclusive range [start, end].
AnyDateTime WithGranularity(TimeSpan granularity)Requires the instant to fall on a lattice of granularity from MinValue — a round instant (a whole second, a quarter-hour, a whole day), built on the grid rather than snapped after the fact, so tick-precision values never surprise a serialization round-trip. Declared once per generator.
AnyDateTime OneOf(params DateTime[] values)Requires the instant to be one of the supplied values. Declared once per generator.
AnyDateTime Except(params DateTime[] values)Requires the instant to be none of the supplied values.
AnyDateTime DifferentFrom(DateTime value)Requires the instant to differ from value — typically an existing value the test already holds. Semantically equivalent to Except; the name carries the intent at the call site.
DateTime Generate()Produces one arbitrary value satisfying every constraint declared on this generator.

sealed class

AnyDateTimeOffset

A fluent generator of arbitrary DateTimeOffset values — the same contract as AnyInt32: constraints express what the surrounding code requires of the value, never what the test asserts; contradictory constraints fail eagerly with a ConflictingAnyConstraintException naming both sides; instances are immutable recipes, and each value is built to satisfy the constraints in one draw.

public sealed class AnyDateTimeOffset
Implements
IAny<DateTimeOffset>, IPoolInspection<DateTimeOffset>

Constructed via

static AnyDateTimeOffset Any.DateTimeOffset()Starts an arbitrary DateTimeOffset generator drawing from the ambient random context: any representable instant unless constrained; generated values carry a zero (UTC) offset. Same constraint algebra as AnyInt32 with the bounds renamed After(...)/Before(...): no sign or zero constraint, no MultipleOf(...), plus WithGranularity(...) and WithOffset(...).

Methods

AnyDateTimeOffset After(DateTimeOffset instant)Requires an instant strictly after instant.
AnyDateTimeOffset AfterOrEqualTo(DateTimeOffset instant)Requires an instant at or after instant.
AnyDateTimeOffset Before(DateTimeOffset instant)Requires an instant strictly before instant.
AnyDateTimeOffset BeforeOrEqualTo(DateTimeOffset instant)Requires an instant at or before instant.
AnyDateTimeOffset Between(DateTimeOffset start, DateTimeOffset end)Requires an instant within the inclusive range [start, end].
AnyDateTimeOffset WithGranularity(TimeSpan granularity)Requires the instant to fall on a lattice of granularity from MinValue — a round instant (a whole second, a quarter-hour, a whole day), built on the grid rather than snapped after the fact, so tick-precision values never surprise a serialization round-trip. Declared once per generator.
AnyDateTimeOffset WithOffset(TimeSpan offset)Pins the offset dimension to offset — every generated value carries exactly that offset, rather than the default Zero. The instant is tightened so the value stays valid at the domain edges. Declared once per generator.
AnyDateTimeOffset WithOffsetBetween(TimeSpan minimum, TimeSpan maximum)Draws the offset dimension from the inclusive range [minimum, maximum] — a bounded, whole-minute offset — so a test can exercise offset-sensitive logic while staying valid. The instant is tightened so every offset in the range stays valid. Declared once per generator.
AnyDateTimeOffset OneOf(params DateTimeOffset[] values)Requires the instant to be one of the supplied values — returned as given, offset included. Declared once per generator.
AnyDateTimeOffset Except(params DateTimeOffset[] values)Requires the instant to be none of the supplied values (compared by instant).
AnyDateTimeOffset DifferentFrom(DateTimeOffset value)Requires the instant to differ from value (compared by instant) — typically an existing value the test already holds. Semantically equivalent to Except; the name carries the intent at the call site.
DateTimeOffset Generate()Produces one arbitrary value satisfying every constraint declared on this generator.

sealed class

AnyDecimal

A fluent generator of arbitrary Decimal values — the same contract as AnyInt32: constraints express what the surrounding code requires of the value, never what the test asserts; contradictory constraints fail eagerly with a ConflictingAnyConstraintException naming both sides; instances are immutable recipes. Exclusive bounds are expressed as the inclusive bound plus a point exclusion, since Decimal has no next-representable-value ladder.

public sealed class AnyDecimal
Implements
IAny<decimal>, IPoolInspection<decimal>

Constructed via

static AnyDecimal Any.Decimal()Starts an arbitrary Decimal generator drawing from the ambient random context: full range unless constrained. Same constraint algebra as AnyInt32, less MultipleOf(...) and plus WithScale(...).

Methods

AnyDecimal Positive()Requires a value strictly greater than zero.
AnyDecimal Negative()Requires a value strictly less than zero.
AnyDecimal Zero()Pins the value to exactly zero.
AnyDecimal NonZero()Requires a value different from zero.
AnyDecimal GreaterThan(decimal value)Requires a value strictly greater than value — the inclusive bound plus a point exclusion.
AnyDecimal GreaterThanOrEqualTo(decimal value)Requires a value greater than or equal to value.
AnyDecimal LessThan(decimal value)Requires a value strictly less than value — the inclusive bound plus a point exclusion.
AnyDecimal LessThanOrEqualTo(decimal value)Requires a value less than or equal to value.
AnyDecimal Between(decimal minimum, decimal maximum)Requires a value within the inclusive range [minimum, maximum].
AnyDecimal WithScale(int scale)Requires the value to be expressible in scale decimal places — a multiple of 10^-scale (a valid amount in cents is WithScale(2)), drawn directly on that grid. A value lattice, not a representation contract: the drawn value lies on the grid but is not padded with trailing zeros. Declared once per generator.
AnyDecimal OneOf(params decimal[] values)Requires the value to be one of the supplied values. Declared once per generator.
AnyDecimal Except(params decimal[] values)Requires the value to be none of the supplied values.
AnyDecimal DifferentFrom(decimal value)Requires the value to differ from value — typically an existing value the test already holds. Semantically equivalent to Except; the name carries the intent at the call site.
decimal Generate()Produces one arbitrary value satisfying every constraint declared on this generator.

sealed class

AnyDouble

A fluent generator of arbitrary Double values — the same contract as AnyInt32: constraints express what the surrounding code requires of the value, never what the test asserts; contradictory constraints fail eagerly with a ConflictingAnyConstraintException naming both sides; instances are immutable recipes. NaN and the infinities are never generated nor accepted.

public sealed class AnyDouble
Implements
IAny<double>, IPoolInspection<double>

Constructed via

static AnyDouble Any.Double()Starts an arbitrary Double generator drawing from the ambient random context: finite values only — NaN and infinities are never generated. Same constraint algebra as AnyInt32, less MultipleOf(...).

Methods

AnyDouble Positive()Requires a value strictly greater than zero.
AnyDouble Negative()Requires a value strictly less than zero.
AnyDouble Zero()Pins the value to exactly zero.
AnyDouble NonZero()Requires a value different from zero.
AnyDouble GreaterThan(double value)Requires a value strictly greater than value.
AnyDouble GreaterThanOrEqualTo(double value)Requires a value greater than or equal to value.
AnyDouble LessThan(double value)Requires a value strictly less than value.
AnyDouble LessThanOrEqualTo(double value)Requires a value less than or equal to value.
AnyDouble Between(double minimum, double maximum)Requires a value within the inclusive range [minimum, maximum].
AnyDouble OneOf(params double[] values)Requires the value to be one of the supplied values. Declared once per generator.
AnyDouble Except(params double[] values)Requires the value to be none of the supplied values.
AnyDouble DifferentFrom(double value)Requires the value to differ from value — typically an existing value the test already holds. Semantically equivalent to Except; the name carries the intent at the call site.
double Generate()Produces one arbitrary value satisfying every constraint declared on this generator.

sealed class

AnyEnum<TEnum>

A fluent generator of arbitrary TEnum values, drawn uniformly from the enum's declared members — never from undeclared numeric values. Constraints narrow the pool (OneOf, Except, DifferentFrom), and a combination that empties it fails with a ConflictingAnyConstraintException naming both sides — before any value is drawn, and whichever order the chain was written in, since AllowingCombinations widens the universe the pool is cut from wherever it appears.

public sealed class AnyEnum<TEnum> where TEnum : struct, Enum
Implements
IAny<TEnum>, IPoolInspection<TEnum>

Constructed via

static AnyEnum<TEnum> Any.Enum<TEnum>() where TEnum : struct, EnumStarts an arbitrary TEnum generator drawing from the ambient random context — uniformly across the enum's declared members, never an undeclared numeric value.

Methods

AnyEnum<TEnum> AllowingCombinations()Widens the draw from the declared members to every combination of them — the values a FlagsAttribute enum is designed to hold. Without it, a flags dummy carries at most one bit and a branch reading two never runs.
AnyEnum<TEnum> OneOf(params TEnum[] values)Requires the value to be one of the supplied members. Declared once per generator.
AnyEnum<TEnum> Except(params TEnum[] values)Requires the value to be none of the supplied ones, compared by equality — under AllowingCombinations too, so Except(Read) forbids Read and still allows Read | Write.
AnyEnum<TEnum> DifferentFrom(TEnum value)Requires the value to differ from value — typically an existing value the test already holds. Semantically equivalent to Except; the name carries the intent at the call site.
TEnum Generate()Produces one arbitrary value satisfying every constraint declared on this generator.

sealed class

AnyGuid

A fluent generator of arbitrary Guid values, drawn from the seedable source — unlike NewGuid, a generated identifier is reproducible inside an Any.Reproducibly(...) run. An unconstrained draw is, for every practical purpose, never Empty; chain NonEmpty to make that requirement explicit, or Empty to pin the empty identifier. Contradictory constraints fail eagerly with a ConflictingAnyConstraintException naming both sides.

public sealed class AnyGuid
Implements
IAny<Guid>, IPoolInspection<Guid>

Constructed via

static AnyGuid Any.Guid()Starts an arbitrary Guid generator drawing from the ambient random context — unlike NewGuid, reproducible inside an Any.Reproducibly(...) run, and for every practical purpose never empty.

Methods

AnyGuid NonEmpty()Requires an identifier different from Empty.
AnyGuid Empty()Pins the identifier to Empty.
AnyGuid OneOf(params Guid[] values)Requires the identifier to be one of the supplied values. Declared once per generator.
AnyGuid Except(params Guid[] values)Requires the identifier to be none of the supplied values.
AnyGuid DifferentFrom(Guid value)Requires the identifier to differ from value — typically an existing value the test already holds. Semantically equivalent to Except; the name carries the intent at the call site.
Guid Generate()Produces one arbitrary value satisfying every constraint declared on this generator.

sealed class

AnyHalf

A fluent generator of arbitrary Half values — the same contract as AnyInt32: constraints express what the surrounding code requires of the value, never what the test asserts; contradictory constraints fail eagerly with a ConflictingAnyConstraintException naming both sides; instances are immutable recipes. NaN and the infinities are never generated nor accepted. Available on the net8.0 target only, like the type itself.

public sealed class AnyHalf
Implements
IAny<Half>, IPoolInspection<Half>

Constructed via

static AnyHalf Any.Half()Starts an arbitrary Half generator drawing from the ambient random context — finite values only. Net8.0 target only, like the type itself.

Methods

AnyHalf Positive()Requires a value strictly greater than zero.
AnyHalf Negative()Requires a value strictly less than zero.
AnyHalf Zero()Pins the value to exactly zero.
AnyHalf NonZero()Requires a value different from zero.
AnyHalf GreaterThan(Half value)Requires a value strictly greater than value.
AnyHalf GreaterThanOrEqualTo(Half value)Requires a value greater than or equal to value.
AnyHalf LessThan(Half value)Requires a value strictly less than value.
AnyHalf LessThanOrEqualTo(Half value)Requires a value less than or equal to value.
AnyHalf Between(Half minimum, Half maximum)Requires a value within the inclusive range [minimum, maximum].
AnyHalf OneOf(params Half[] values)Requires the value to be one of the supplied values. Declared once per generator.
AnyHalf Except(params Half[] values)Requires the value to be none of the supplied values.
AnyHalf DifferentFrom(Half value)Requires the value to differ from value — typically an existing value the test already holds. Semantically equivalent to Except; the name carries the intent at the call site.
Half Generate()Produces one arbitrary value satisfying every constraint declared on this generator.

sealed class

AnyInt128

A fluent generator of arbitrary Int128 values — the same contract as AnyInt32: constraints express what the surrounding code requires of the value, never what the test asserts; contradictory constraints fail eagerly with a ConflictingAnyConstraintException naming both sides; instances are immutable recipes, and each value is built to satisfy the constraints in one draw. Available on the net8.0 target only, like the type itself.

public sealed class AnyInt128
Implements
IAny<Int128>, IPoolInspection<Int128>

Constructed via

static AnyInt128 Any.Int128()Starts an arbitrary Int128 generator drawing from the ambient random context — full range unless constrained. Net8.0 target only, like the type itself.

Methods

AnyInt128 Positive()Requires a value strictly greater than zero.
AnyInt128 Negative()Requires a value strictly less than zero.
AnyInt128 Zero()Pins the value to exactly zero. Useful for symmetry with the other constraints when a test sweeps cases.
AnyInt128 NonZero()Requires a value different from zero.
AnyInt128 GreaterThan(Int128 value)Requires a value strictly greater than value.
AnyInt128 GreaterThanOrEqualTo(Int128 value)Requires a value greater than or equal to value.
AnyInt128 LessThan(Int128 value)Requires a value strictly less than value.
AnyInt128 LessThanOrEqualTo(Int128 value)Requires a value less than or equal to value.
AnyInt128 Between(Int128 minimum, Int128 maximum)Requires a value within the inclusive range [minimum, maximum].
AnyInt128 MultipleOf(Int128 value)Requires the value to be a multiple of value — drawn directly on that lattice, so the declared range keeps its meaning (unlike a post-hoc As(x => x * k) projection). Declared once per generator.
AnyInt128 OneOf(params Int128[] values)Requires the value to be one of the supplied values. Declared once per generator.
AnyInt128 Except(params Int128[] values)Requires the value to be none of the supplied values.
AnyInt128 DifferentFrom(Int128 value)Requires the value to differ from value — typically an existing value the test already holds. Semantically equivalent to Except; the name carries the intent at the call site.
Int128 Generate()Produces one arbitrary value satisfying every constraint declared on this generator.

sealed class

AnyInt16

A fluent generator of arbitrary Int16 values — the same contract as AnyInt32: constraints express what the surrounding code requires of the value, never what the test asserts; contradictory constraints fail eagerly with a ConflictingAnyConstraintException naming both sides; instances are immutable recipes, and each value is built to satisfy the constraints in one draw.

public sealed class AnyInt16
Implements
IAny<short>, IPoolInspection<short>

Constructed via

static AnyInt16 Any.Int16()Starts an arbitrary Int16 generator drawing from the ambient random context: full range unless constrained. Same constraint algebra as AnyInt32.

Methods

AnyInt16 Positive()Requires a value strictly greater than zero.
AnyInt16 Negative()Requires a value strictly less than zero.
AnyInt16 Zero()Pins the value to exactly zero. Useful for symmetry with the other constraints when a test sweeps cases.
AnyInt16 NonZero()Requires a value different from zero.
AnyInt16 GreaterThan(short value)Requires a value strictly greater than value.
AnyInt16 GreaterThanOrEqualTo(short value)Requires a value greater than or equal to value.
AnyInt16 LessThan(short value)Requires a value strictly less than value.
AnyInt16 LessThanOrEqualTo(short value)Requires a value less than or equal to value.
AnyInt16 Between(short minimum, short maximum)Requires a value within the inclusive range [minimum, maximum].
AnyInt16 MultipleOf(short value)Requires the value to be a multiple of value — drawn directly on that lattice, so the declared range keeps its meaning (unlike a post-hoc As(x => x * k) projection). Declared once per generator.
AnyInt16 OneOf(params short[] values)Requires the value to be one of the supplied values. Declared once per generator.
AnyInt16 Except(params short[] values)Requires the value to be none of the supplied values.
AnyInt16 DifferentFrom(short value)Requires the value to differ from value — typically an existing value the test already holds. Semantically equivalent to Except; the name carries the intent at the call site.
short Generate()Produces one arbitrary value satisfying every constraint declared on this generator.

sealed class

AnyInt32

A fluent generator of arbitrary Int32 values. Each constraint narrows the domain the value is drawn from — the constraints express what the surrounding code requires of the value (an invariant, a precondition), never what the test asserts. Constraints that contradict each other fail immediately with a ConflictingAnyConstraintException naming both sides, so an impossible Arrange reads as the test defect it is.

public sealed class AnyInt32
Implements
IAny<int>, IPoolInspection<int>

Constructed via

static AnyInt32 Any.Int32()Starts an arbitrary Int32 generator drawing from the ambient random context. Unconstrained, it draws from the full Int32 range; chain constraints to express what the surrounding code requires (Positive(), Between(...), ...).

Methods

AnyInt32 Positive()Requires a value strictly greater than zero.
AnyInt32 Negative()Requires a value strictly less than zero.
AnyInt32 Zero()Pins the value to exactly zero. Useful for symmetry with the other constraints when a test sweeps cases.
AnyInt32 NonZero()Requires a value different from zero.
AnyInt32 GreaterThan(int value)Requires a value strictly greater than value.
AnyInt32 GreaterThanOrEqualTo(int value)Requires a value greater than or equal to value.
AnyInt32 LessThan(int value)Requires a value strictly less than value.
AnyInt32 LessThanOrEqualTo(int value)Requires a value less than or equal to value.
AnyInt32 Between(int minimum, int maximum)Requires a value within the inclusive range [minimum, maximum].
AnyInt32 MultipleOf(int value)Requires the value to be a multiple of value — drawn directly on that lattice, so the declared range keeps its meaning (unlike a post-hoc As(x => x * k) projection). Declared once per generator.
AnyInt32 OneOf(params int[] values)Requires the value to be one of the supplied values. Declared once per generator.
AnyInt32 Except(params int[] values)Requires the value to be none of the supplied values.
AnyInt32 DifferentFrom(int value)Requires the value to differ from value — typically an existing value the test already holds. Semantically equivalent to Except; the name carries the intent at the call site.
int Generate()Produces one arbitrary value satisfying every constraint declared on this generator.

sealed class

AnyInt64

A fluent generator of arbitrary Int64 values — the same contract as AnyInt32: constraints express what the surrounding code requires of the value, never what the test asserts; contradictory constraints fail eagerly with a ConflictingAnyConstraintException naming both sides; instances are immutable recipes, and each value is built to satisfy the constraints in one draw.

public sealed class AnyInt64
Implements
IAny<long>, IPoolInspection<long>

Constructed via

static AnyInt64 Any.Int64()Starts an arbitrary Int64 generator drawing from the ambient random context: full range unless constrained. Same constraint algebra as AnyInt32.

Methods

AnyInt64 Positive()Requires a value strictly greater than zero.
AnyInt64 Negative()Requires a value strictly less than zero.
AnyInt64 Zero()Pins the value to exactly zero. Useful for symmetry with the other constraints when a test sweeps cases.
AnyInt64 NonZero()Requires a value different from zero.
AnyInt64 GreaterThan(long value)Requires a value strictly greater than value.
AnyInt64 GreaterThanOrEqualTo(long value)Requires a value greater than or equal to value.
AnyInt64 LessThan(long value)Requires a value strictly less than value.
AnyInt64 LessThanOrEqualTo(long value)Requires a value less than or equal to value.
AnyInt64 Between(long minimum, long maximum)Requires a value within the inclusive range [minimum, maximum].
AnyInt64 MultipleOf(long value)Requires the value to be a multiple of value — drawn directly on that lattice, so the declared range keeps its meaning (unlike a post-hoc As(x => x * k) projection). Declared once per generator.
AnyInt64 OneOf(params long[] values)Requires the value to be one of the supplied values. Declared once per generator.
AnyInt64 Except(params long[] values)Requires the value to be none of the supplied values.
AnyInt64 DifferentFrom(long value)Requires the value to differ from value — typically an existing value the test already holds. Semantically equivalent to Except; the name carries the intent at the call site.
long Generate()Produces one arbitrary value satisfying every constraint declared on this generator.

sealed class

AnyPattern

A generator of arbitrary strings that match a regular expression — the dummy for a value whose format is defined by a pattern (an order reference, a SKU, a currency code). The pattern is the whole shape of the specification: unlike AnyString this generator exposes no further shape or length constraints — express those inside the pattern instead. What it does expose is the exclusion pair Except and DifferentFrom, which every other generator carries. It also composes like any other generator: pipe it through As(...) into a value object, make it optional with OrNull(), or fold it into Combine(...) and the collection generators.

public sealed class AnyPattern
Implements
IAny<string>

Constructed via

static AnyPattern Any.StringMatching(string pattern)Starts a generator of arbitrary strings that match pattern, drawing from the ambient random context. The pattern is the whole shape of the specification — the returned generator carries no further shape or length constraints; express those inside the pattern. It does carry the exclusion pair Except/DifferentFrom, which rejects rather than constructs, and it composes through As(...), OrNull(), Combine(...) and the collection generators.
static AnyPattern Any.StringMatching(Regex pattern)Starts a generator of arbitrary strings matching pattern — the same contract as StringMatching, taking a compiled Regex so a test can reuse the very object its production code validates with. IgnoreCase is honoured. IgnorePatternWhitespace changes how the pattern text itself is read and is rejected; the remaining options do not change which strings the pattern matches and are ignored.

Methods

AnyPattern Except(params string[] values)Requires the generated value to be none of the supplied values. May be declared several times; the exclusions accumulate. The pattern still builds the value — an exclusion only rejects and redraws — so a pattern whose language the exclusions leave nothing of surfaces at Generate as a seed-bearing AnyGenerationException, never as a declaration-time conflict: the library does not enumerate a regular language to prove it empty. Comparison is ordinal, like string equality itself, whether or not the pattern ignores case.
AnyPattern DifferentFrom(string value)Requires the generated value to differ from value — typically an existing value the test already holds, to exercise an inequality path while keeping the format the pattern defines (Any.StringMatching(@"^ORD-\d{8}$").DifferentFrom(existing)). Semantically equivalent to Except; the name carries the intent at the call site.
string Generate()Produces one arbitrary value satisfying every constraint declared on this generator.

sealed class

AnySByte

A fluent generator of arbitrary SByte values — the same contract as AnyInt32: constraints express what the surrounding code requires of the value, never what the test asserts; contradictory constraints fail eagerly with a ConflictingAnyConstraintException naming both sides; instances are immutable recipes, and each value is built to satisfy the constraints in one draw.

public sealed class AnySByte
Implements
IAny<sbyte>, IPoolInspection<sbyte>

Constructed via

static AnySByte Any.SByte()Starts an arbitrary SByte generator drawing from the ambient random context: full range unless constrained. Same constraint algebra as AnyInt32.

Methods

AnySByte Positive()Requires a value strictly greater than zero.
AnySByte Negative()Requires a value strictly less than zero.
AnySByte Zero()Pins the value to exactly zero. Useful for symmetry with the other constraints when a test sweeps cases.
AnySByte NonZero()Requires a value different from zero.
AnySByte GreaterThan(sbyte value)Requires a value strictly greater than value.
AnySByte GreaterThanOrEqualTo(sbyte value)Requires a value greater than or equal to value.
AnySByte LessThan(sbyte value)Requires a value strictly less than value.
AnySByte LessThanOrEqualTo(sbyte value)Requires a value less than or equal to value.
AnySByte Between(sbyte minimum, sbyte maximum)Requires a value within the inclusive range [minimum, maximum].
AnySByte MultipleOf(sbyte value)Requires the value to be a multiple of value — drawn directly on that lattice, so the declared range keeps its meaning (unlike a post-hoc As(x => x * k) projection). Declared once per generator.
AnySByte OneOf(params sbyte[] values)Requires the value to be one of the supplied values. Declared once per generator.
AnySByte Except(params sbyte[] values)Requires the value to be none of the supplied values.
AnySByte DifferentFrom(sbyte value)Requires the value to differ from value — typically an existing value the test already holds. Semantically equivalent to Except; the name carries the intent at the call site.
sbyte Generate()Produces one arbitrary value satisfying every constraint declared on this generator.

sealed class

AnySingle

A fluent generator of arbitrary Single values — the same contract as AnyInt32: constraints express what the surrounding code requires of the value, never what the test asserts; contradictory constraints fail eagerly with a ConflictingAnyConstraintException naming both sides; instances are immutable recipes. NaN and the infinities are never generated nor accepted.

public sealed class AnySingle
Implements
IAny<float>, IPoolInspection<float>

Constructed via

static AnySingle Any.Single()Starts an arbitrary Single generator drawing from the ambient random context: finite values only — NaN and infinities are never generated. Same constraint algebra as AnyInt32, less MultipleOf(...).

Methods

AnySingle Positive()Requires a value strictly greater than zero.
AnySingle Negative()Requires a value strictly less than zero.
AnySingle Zero()Pins the value to exactly zero.
AnySingle NonZero()Requires a value different from zero.
AnySingle GreaterThan(float value)Requires a value strictly greater than value.
AnySingle GreaterThanOrEqualTo(float value)Requires a value greater than or equal to value.
AnySingle LessThan(float value)Requires a value strictly less than value.
AnySingle LessThanOrEqualTo(float value)Requires a value less than or equal to value.
AnySingle Between(float minimum, float maximum)Requires a value within the inclusive range [minimum, maximum].
AnySingle OneOf(params float[] values)Requires the value to be one of the supplied values. Declared once per generator.
AnySingle Except(params float[] values)Requires the value to be none of the supplied values.
AnySingle DifferentFrom(float value)Requires the value to differ from value — typically an existing value the test already holds. Semantically equivalent to Except; the name carries the intent at the call site.
float Generate()Produces one arbitrary value satisfying every constraint declared on this generator.

sealed class

AnyString

A fluent generator of arbitrary String values. Each constraint narrows the shape of the generated string — the constraints express what the surrounding code requires of the value (a value object's format invariant, a contract precondition), never what the test asserts. Constraints that contradict each other fail immediately with a ConflictingAnyConstraintException naming both sides, so an impossible Arrange reads as the test defect it is.

public sealed class AnyString
Implements
IAny<string>, IPoolInspection<string>

Constructed via

static AnyString Any.String()Starts an arbitrary String generator drawing from the ambient random context. Unconstrained, it yields 0 to 1024 characters drawn from the whole of ASCII, control characters included (ADR-0075, ADR-0076); chain constraints to express what the surrounding code requires (NonEmpty(), WithMaxLength(...), Printable(), StartingWith(...), ...).

Methods

AnyString NonEmpty()Requires at least one character.
AnyString NotBlank()Requires at least one character that is not whitespace — what a domain guarding with IsNullOrWhiteSpace demands, and with it the floor of one character NonEmpty gives.
AnyString WithLength(int length)Fixes the exact length. Declared once per generator.
AnyString WithMinLength(int length)Requires at least length characters. With no maximum beside it the draw spans length to length plus the default spread; declare a maximum to say where it stops.
AnyString WithMaxLength(int length)Requires at most length characters, and steers the draw: the range becomes [minimum, length], so the bound you write is the bound you get (ADR-0076). It is therefore a size the generator may have to produce, and is refused above 1000000 like every other.
AnyString WithLengthBetween(int minimum, int maximum)Requires a length within the inclusive range [minimum, maximum], and draws across it. Equivalent to declaring the two bounds separately and behaves identically, which is what keeps the range decomposable.
AnyString StartingWith(string prefix)Requires the string to start with prefix. Declared once per generator. The prefix is a literal, not a draw: it is kept exactly as written, and the declared character family, subtractions and casing govern the drawn characters beside it rather than the prefix itself (ADR-0079). Its length still counts against the declared length.
AnyString EndingWith(string suffix)Requires the string to end with suffix. Declared once per generator. Like a prefix it is a literal rather than a draw, so the declared character constraints leave it exactly as written and govern the drawn characters beside it (ADR-0079). Its length still counts against the declared length.
AnyString Containing(string value)Requires the string to contain value. May be declared several times; the contained values are laid out side by side, without overlap, between the prefix and the suffix. Each is a literal rather than a draw, so the declared character constraints leave it exactly as written and govern the drawn characters around it (ADR-0079). Their lengths still count against the declared length.
AnyString Alpha()Restricts the string to ASCII letters only. Declared once per generator. Governs the characters drawn, not an anchored literal.
AnyString Numeric()Restricts the string to ASCII digits only. Declared once per generator. Governs the characters drawn, not an anchored literal.
AnyString AlphaNumeric()Restricts the string to ASCII letters and digits only. Declared once per generator. Governs the characters drawn, not an anchored literal.
AnyString Punctuation()Restricts the string to ASCII punctuation — the 32 printable characters that are neither a letter, a digit nor the space, POSIX [:punct:]. The family to declare when the surrounding code requires text it must not read as alphanumeric. Broader than IsPunctuation, which classifies +, < and $ as symbols rather than punctuation. Declared once per generator. Governs the characters drawn, not an anchored literal.
AnyString Printable()Restricts the string to printable ASCII — every character from the space (0x20) to ~ (0x7E). The family to declare when the surrounding code cannot take a control character: an unconstrained draw spans the whole of ASCII, so a carriage return or a NUL is exactly what it may hand you. Declared once per generator. Governs the characters drawn, not an anchored literal.
AnyString NonPrintable()Restricts the string to the ASCII characters that are not printable — the C0 controls and DEL. The family to declare when the code under test is meant to reject or strip them. Declared once per generator. Governs the characters drawn, not an anchored literal.
AnyString Whitespaces()Restricts the string to ASCII whitespace — the space and the tab, the readable pair the regex generator already draws \s from. Declared once per generator. Governs the characters drawn, not an anchored literal.
AnyString Hexadecimal()Restricts the string to the base-16 alphabet of RFC 4648 — 0-9, A-F and a-f. Chain InLowerCase or InUpperCase for the single-case form a hash or a colour usually requires. Declared once per generator. Governs the characters drawn, not an anchored literal.
AnyString WithoutAlpha()Removes the ASCII letters from whatever the generator would otherwise draw. Unlike a family, a subtraction does not occupy the one family slot and several accumulate, so WithoutAlpha().WithoutNumeric() leaves the punctuation, the whitespace and the controls. Governs the characters drawn, not an anchored literal.
AnyString WithoutNumeric()Removes the ASCII digits from whatever the generator would otherwise draw. Accumulates with WithoutAlpha rather than replacing it. Governs the characters drawn, not an anchored literal.
AnyString WithChars(string pool)Restricts the string to the characters of an explicit pool — a custom alphabet, the general form of Alpha/Numeric/AlphaNumeric. Use it to reach characters the named sets cannot, most notably non-ASCII text (accents, other scripts), without a StringMatching literal. Declared once per generator: it occupies the same character-family slot as the named sets, and because the pool is the whole character definition it cannot combine with InLowerCase/InUpperCase — put only the casing you want in the pool. An anchored fragment (prefix, suffix, contained value) is exempt: the pool is what the generator draws from, and a literal the caller wrote is not drawn, so it is kept as written even when the pool could not produce it (ADR-0079). Duplicate characters collapse and each distinct character is equally likely. The pool is a sequence of UTF-16 code units and must stay within the Basic Multilingual Plane: a surrogate — an emoji or other astral code point, which spans two units — is rejected, because it would be drawn and split unit by unit; draw such values as whole strings with OneOf instead.
AnyString InLowerCase()Requires every alphabetic character the generator draws to be lowercase. Declared once per generator. An anchored literal is exempt, so InLowerCase().StartingWith("ORD-") yields ORD- followed by lowercase filler (ADR-0079).
AnyString InUpperCase()Requires every alphabetic character the generator draws to be uppercase. Declared once per generator. An anchored literal is exempt, so a lowercase prefix is kept as written beside uppercase filler (ADR-0079).
AnyString Except(params string[] values)Requires the generated string to be none of the supplied values. May be declared several times; the exclusions accumulate. On a shaped string, and unlike the shape constraints, an exclusion is met by a bounded redraw of the constructed layout, so one tight enough to leave the shape unsatisfiable surfaces at Generate as a seed-bearing AnyGenerationException rather than as a declaration-time conflict. On a string drawn from a value set (OneOf) there is nothing to redraw: the excluded values are removed from the set at once, and removing all of them is a conflict here and now. The empty string is a valid value to exclude; a null element is not.
AnyString DifferentFrom(string value)Requires the generated string to differ from value — typically an existing value the test already holds, to exercise an inequality path while preserving the declared shape. Semantically equivalent to Except, including when a value set is in force; the name carries the intent at the call site.
AnyString OneOf(params string[] values)Draws the string from an explicit, fixed set of values instead of shaping one — the dummy for a value whose domain is a closed list the test does not assert on (a currency code, a well-known name). Declared once per generator, and composable like every other family's OneOf: the other constraints keep their meaning and narrow the set rather than shaping a string, so OneOf("abc", "de").WithLength(3) yields "abc". A constraint no supplied value satisfies is a ConflictingAnyConstraintException naming both sides, whichever order the two were declared in. Duplicate values are collapsed; the generated string is one of the surviving values, drawn uniformly and reproducibly under a seed.
AnyString OneOf(IEnumerable<string> values)Draws the string from an explicit, fixed set of values — the IEnumerable counterpart of OneOf, for a set already held as a sequence (a list, a LINQ result, values loaded at test setup). Same contract: the set composes with the other constraints, duplicates collapse, and the draw is uniform and reproducible under a seed.
string Generate()Produces one arbitrary value satisfying every constraint declared on this generator.

sealed class

AnyTimeOnly

A fluent generator of arbitrary TimeOnly values — the same contract as AnyInt32: constraints express what the surrounding code requires of the value, never what the test asserts; contradictory constraints fail eagerly with a ConflictingAnyConstraintException naming both sides; instances are immutable recipes, and each value is built to satisfy the constraints in one draw. Available on the net8.0 target only, like the type itself. There is deliberately no clock-relative constraint: a reproducible test pins its reference time of days explicitly with After and Before.

public sealed class AnyTimeOnly
Implements
IAny<TimeOnly>, IPoolInspection<TimeOnly>

Constructed via

static AnyTimeOnly Any.TimeOnly()Starts an arbitrary TimeOnly generator drawing from the ambient random context — any time of day unless constrained. Net8.0 target only, like the type itself.

Methods

AnyTimeOnly After(TimeOnly time)Requires a time of day strictly after time.
AnyTimeOnly AfterOrEqualTo(TimeOnly time)Requires a time of day at or after time.
AnyTimeOnly Before(TimeOnly time)Requires a time of day strictly before time.
AnyTimeOnly BeforeOrEqualTo(TimeOnly time)Requires a time of day at or before time.
AnyTimeOnly Between(TimeOnly start, TimeOnly end)Requires a time of day within the inclusive range [start, end].
AnyTimeOnly WithGranularity(TimeSpan granularity)Requires the time of day to fall on a lattice of granularity from MinValue — a round time of day (a whole second, a quarter-hour), built on the grid rather than snapped after the fact, so tick-precision values never surprise a serialization round-trip. Declared once per generator.
AnyTimeOnly OneOf(params TimeOnly[] values)Requires the time of day to be one of the supplied values. Declared once per generator.
AnyTimeOnly Except(params TimeOnly[] values)Requires the time of day to be none of the supplied values.
AnyTimeOnly DifferentFrom(TimeOnly value)Requires the time of day to differ from value — typically an existing value the test already holds. Semantically equivalent to Except; the name carries the intent at the call site.
TimeOnly Generate()Produces one arbitrary value satisfying every constraint declared on this generator.

sealed class

AnyTimeSpan

A fluent generator of arbitrary TimeSpan values — the same contract as AnyInt32: constraints express what the surrounding code requires of the value, never what the test asserts; contradictory constraints fail eagerly with a ConflictingAnyConstraintException naming both sides; instances are immutable recipes, and each value is built to satisfy the constraints in one draw. Unconstrained, it draws from the full TimeSpan range, negative durations included.

public sealed class AnyTimeSpan
Implements
IAny<TimeSpan>, IPoolInspection<TimeSpan>

Constructed via

static AnyTimeSpan Any.TimeSpan()Starts an arbitrary TimeSpan generator drawing from the ambient random context: full range unless constrained, negative durations included. Same constraint algebra as AnyInt32, less MultipleOf(...) and plus WithGranularity(...).

Methods

AnyTimeSpan Positive()Requires a duration strictly greater than Zero.
AnyTimeSpan Negative()Requires a duration strictly less than Zero.
AnyTimeSpan Zero()Pins the duration to exactly Zero.
AnyTimeSpan NonZero()Requires a duration different from Zero.
AnyTimeSpan GreaterThan(TimeSpan value)Requires a duration strictly greater than value.
AnyTimeSpan GreaterThanOrEqualTo(TimeSpan value)Requires a duration greater than or equal to value.
AnyTimeSpan LessThan(TimeSpan value)Requires a duration strictly less than value.
AnyTimeSpan LessThanOrEqualTo(TimeSpan value)Requires a duration less than or equal to value.
AnyTimeSpan Between(TimeSpan minimum, TimeSpan maximum)Requires a duration within the inclusive range [minimum, maximum].
AnyTimeSpan WithGranularity(TimeSpan granularity)Requires the duration to fall on a lattice of granularity from Zero — a whole number of that granularity, built on the grid rather than snapped after the fact, so tick-precision values never surprise a serialization round-trip. Declared once per generator.
AnyTimeSpan OneOf(params TimeSpan[] values)Requires the duration to be one of the supplied values. Declared once per generator.
AnyTimeSpan Except(params TimeSpan[] values)Requires the duration to be none of the supplied values.
AnyTimeSpan DifferentFrom(TimeSpan value)Requires the duration to differ from value — typically an existing value the test already holds. Semantically equivalent to Except; the name carries the intent at the call site.
TimeSpan Generate()Produces one arbitrary value satisfying every constraint declared on this generator.

sealed class

AnyUInt128

A fluent generator of arbitrary UInt128 values — the same contract as AnyInt32: constraints express what the surrounding code requires of the value, never what the test asserts; contradictory constraints fail eagerly with a ConflictingAnyConstraintException naming both sides; instances are immutable recipes, and each value is built to satisfy the constraints in one draw. Available on the net8.0 target only, like the type itself.

public sealed class AnyUInt128
Implements
IAny<UInt128>, IPoolInspection<UInt128>

Constructed via

static AnyUInt128 Any.UInt128()Starts an arbitrary UInt128 generator drawing from the ambient random context — full range unless constrained. Net8.0 target only, like the type itself.

Methods

AnyUInt128 Zero()Pins the value to exactly zero. Useful for symmetry with the other constraints when a test sweeps cases.
AnyUInt128 NonZero()Requires a value different from zero.
AnyUInt128 GreaterThan(UInt128 value)Requires a value strictly greater than value.
AnyUInt128 GreaterThanOrEqualTo(UInt128 value)Requires a value greater than or equal to value.
AnyUInt128 LessThan(UInt128 value)Requires a value strictly less than value.
AnyUInt128 LessThanOrEqualTo(UInt128 value)Requires a value less than or equal to value.
AnyUInt128 Between(UInt128 minimum, UInt128 maximum)Requires a value within the inclusive range [minimum, maximum].
AnyUInt128 MultipleOf(UInt128 value)Requires the value to be a multiple of value — drawn directly on that lattice, so the declared range keeps its meaning (unlike a post-hoc As(x => x * k) projection). Declared once per generator.
AnyUInt128 OneOf(params UInt128[] values)Requires the value to be one of the supplied values. Declared once per generator.
AnyUInt128 Except(params UInt128[] values)Requires the value to be none of the supplied values.
AnyUInt128 DifferentFrom(UInt128 value)Requires the value to differ from value — typically an existing value the test already holds. Semantically equivalent to Except; the name carries the intent at the call site.
UInt128 Generate()Produces one arbitrary value satisfying every constraint declared on this generator.

sealed class

AnyUInt16

A fluent generator of arbitrary UInt16 values — the same contract as AnyInt32: constraints express what the surrounding code requires of the value, never what the test asserts; contradictory constraints fail eagerly with a ConflictingAnyConstraintException naming both sides; instances are immutable recipes, and each value is built to satisfy the constraints in one draw.

public sealed class AnyUInt16
Implements
IAny<ushort>, IPoolInspection<ushort>

Constructed via

static AnyUInt16 Any.UInt16()Starts an arbitrary UInt16 generator drawing from the ambient random context: full range unless constrained. Same constraint algebra as AnyInt32, less Positive() and Negative(), which an unsigned type cannot express.

Methods

AnyUInt16 Zero()Pins the value to exactly zero. Useful for symmetry with the other constraints when a test sweeps cases.
AnyUInt16 NonZero()Requires a value different from zero.
AnyUInt16 GreaterThan(ushort value)Requires a value strictly greater than value.
AnyUInt16 GreaterThanOrEqualTo(ushort value)Requires a value greater than or equal to value.
AnyUInt16 LessThan(ushort value)Requires a value strictly less than value.
AnyUInt16 LessThanOrEqualTo(ushort value)Requires a value less than or equal to value.
AnyUInt16 Between(ushort minimum, ushort maximum)Requires a value within the inclusive range [minimum, maximum].
AnyUInt16 MultipleOf(ushort value)Requires the value to be a multiple of value — drawn directly on that lattice, so the declared range keeps its meaning (unlike a post-hoc As(x => x * k) projection). Declared once per generator.
AnyUInt16 OneOf(params ushort[] values)Requires the value to be one of the supplied values. Declared once per generator.
AnyUInt16 Except(params ushort[] values)Requires the value to be none of the supplied values.
AnyUInt16 DifferentFrom(ushort value)Requires the value to differ from value — typically an existing value the test already holds. Semantically equivalent to Except; the name carries the intent at the call site.
ushort Generate()Produces one arbitrary value satisfying every constraint declared on this generator.

sealed class

AnyUInt32

A fluent generator of arbitrary UInt32 values — the same contract as AnyInt32: constraints express what the surrounding code requires of the value, never what the test asserts; contradictory constraints fail eagerly with a ConflictingAnyConstraintException naming both sides; instances are immutable recipes, and each value is built to satisfy the constraints in one draw.

public sealed class AnyUInt32
Implements
IAny<uint>, IPoolInspection<uint>

Constructed via

static AnyUInt32 Any.UInt32()Starts an arbitrary UInt32 generator drawing from the ambient random context: full range unless constrained. Same constraint algebra as AnyInt32, less Positive() and Negative(), which an unsigned type cannot express.

Methods

AnyUInt32 Zero()Pins the value to exactly zero. Useful for symmetry with the other constraints when a test sweeps cases.
AnyUInt32 NonZero()Requires a value different from zero.
AnyUInt32 GreaterThan(uint value)Requires a value strictly greater than value.
AnyUInt32 GreaterThanOrEqualTo(uint value)Requires a value greater than or equal to value.
AnyUInt32 LessThan(uint value)Requires a value strictly less than value.
AnyUInt32 LessThanOrEqualTo(uint value)Requires a value less than or equal to value.
AnyUInt32 Between(uint minimum, uint maximum)Requires a value within the inclusive range [minimum, maximum].
AnyUInt32 MultipleOf(uint value)Requires the value to be a multiple of value — drawn directly on that lattice, so the declared range keeps its meaning (unlike a post-hoc As(x => x * k) projection). Declared once per generator.
AnyUInt32 OneOf(params uint[] values)Requires the value to be one of the supplied values. Declared once per generator.
AnyUInt32 Except(params uint[] values)Requires the value to be none of the supplied values.
AnyUInt32 DifferentFrom(uint value)Requires the value to differ from value — typically an existing value the test already holds. Semantically equivalent to Except; the name carries the intent at the call site.
uint Generate()Produces one arbitrary value satisfying every constraint declared on this generator.

sealed class

AnyUInt64

A fluent generator of arbitrary UInt64 values — the same contract as AnyInt32: constraints express what the surrounding code requires of the value, never what the test asserts; contradictory constraints fail eagerly with a ConflictingAnyConstraintException naming both sides; instances are immutable recipes, and each value is built to satisfy the constraints in one draw.

public sealed class AnyUInt64
Implements
IAny<ulong>, IPoolInspection<ulong>

Constructed via

static AnyUInt64 Any.UInt64()Starts an arbitrary UInt64 generator drawing from the ambient random context: full range unless constrained. Same constraint algebra as AnyInt32, less Positive() and Negative(), which an unsigned type cannot express.

Methods

AnyUInt64 Zero()Pins the value to exactly zero. Useful for symmetry with the other constraints when a test sweeps cases.
AnyUInt64 NonZero()Requires a value different from zero.
AnyUInt64 GreaterThan(ulong value)Requires a value strictly greater than value.
AnyUInt64 GreaterThanOrEqualTo(ulong value)Requires a value greater than or equal to value.
AnyUInt64 LessThan(ulong value)Requires a value strictly less than value.
AnyUInt64 LessThanOrEqualTo(ulong value)Requires a value less than or equal to value.
AnyUInt64 Between(ulong minimum, ulong maximum)Requires a value within the inclusive range [minimum, maximum].
AnyUInt64 MultipleOf(ulong value)Requires the value to be a multiple of value — drawn directly on that lattice, so the declared range keeps its meaning (unlike a post-hoc As(x => x * k) projection). Declared once per generator.
AnyUInt64 OneOf(params ulong[] values)Requires the value to be one of the supplied values. Declared once per generator.
AnyUInt64 Except(params ulong[] values)Requires the value to be none of the supplied values.
AnyUInt64 DifferentFrom(ulong value)Requires the value to differ from value — typically an existing value the test already holds. Semantically equivalent to Except; the name carries the intent at the call site.
ulong Generate()Produces one arbitrary value satisfying every constraint declared on this generator.