JustDummies

Just dummies — but seriously powerful ones.

Documentation sections

JustDummies

The library itself: the Any entry point, every generator, the reproducibility scopes, and the 33 rules that guard correct usage.

Install

dotnet add package JustDummies

It takes no runtime dependency. Adding it puts one assembly and one analyzer set into your test project and nothing else into your dependency graph.

What you get

Any.*a factory for every BCL primitive, plus collections, URIs and choices
IAny<T>the seam every generator implements, and the currency of composition
Any.Reproducibly / UseSeed / WithSeedthe reproducibility scopes
AnyContextan isolated, seeded world with the same factories on it
DummyException and its three subtypesthe failure vocabulary
33 Roslyn rulesbundled inside the package, active on your next build

The analyzers travel inside the package

The rules are packed at analyzers/dotnet/cs, which is the convention NuGet reads to load analyzers automatically. Referencing JustDummies is therefore the whole installation: there is no companion analyzer package to remember, and no version of one to keep in step (ADR-0023 opens in a new tab).

They exist because the type system cannot reach where these mistakes live — a generator rendered as text, a constraint whose result is discarded, a seed pinned outside its scope, a chain admitting no value. See the analyzer rules index for all 33, and JD005 for the one that catches the most common slip.

To tune a severity, use .editorconfig:

# turn an opt-in rule on
dotnet_diagnostic.JD011.severity = warning

# or silence one you do not want
dotnet_diagnostic.JD024.severity = none

Target frameworks

AssetCarries
netstandard2.0the whole library, minus the five modern-type factories
net8.0the same, plus Any.DateOnly(), Any.TimeOnly(), Any.Int128(), Any.UInt128(), Any.Half()

Those five factories are absent downlevel because the types are: DateOnly, TimeOnly, Int128, UInt128 and Half arrived after netstandard2.0. Nothing is emulated, which is why a value drawn on either asset is the real type rather than a stand-in.

The supported .NET Framework floor is 4.7.2, exercised in CI against the netstandard2.0 asset that .NET Framework consumers actually load (ADR-0007 opens in a new tab).

A short tour

// A scalar, constrained by its domain invariants.
int quantity = Any.Int32().Between(1, 100).Generate();

// A value object, built through its real factory.
OrderReference reference = Any.String().StartingWith("ORD-").WithLength(12)
                              .As(OrderReference.Create)
                              .Generate();

// A collection of them.
List<OrderReference> basket = Any.ListOf(Any.String().StartingWith("ORD-").WithLength(12)
                                            .As(OrderReference.Create))
                                 .WithCountBetween(1, 4)
                                 .Generate();

// All of it replayable from one integer.
Any.Reproducibly(() => Assert.InRange(Any.Int32().Between(1, 100).Generate(), 1, 100));

Where to go from here:

Read the source, or correct it there opens in a new tab· Mirrored from lib-v1.0.0-preview.6