JustDummies

Just dummies — but seriously powerful ones.

Documentation sections

JD021: BlankReplaySnippet

PropertyValue
CategoryReproducibility (JustDummies.Reproducibility)
Severity🟠 Warning
Enabled by defaultYes

Any.UseSeed(int, string) supplies the replay snippet — the code a reader copies to replay the run — that generation-failure guidance quotes verbatim. It rejects a blank one at run time.

What makes the compile-time check worth having is where that throw lands. This overload exists for a test-framework adapter, which opens the scope from a hook that runs before every test. A blank snippet therefore fails the whole suite as an infrastructure error, not one assertion — a disproportionately expensive way to learn about a typo the compiler can already see.

Noncompliant

using IDisposable scope = Any.UseSeed(1234, "");     // JD021
using IDisposable scope = Any.UseSeed(1234, "   ");  // JD021

Compliant

using IDisposable scope = Any.UseSeed(1234, "[Reproducible(Seed = 1234)]");

// Or drop the argument: the default snippet names Any.Reproducibly(seed, ...).
using IDisposable scope = Any.UseSeed(1234);

Pass the code itself — an attribute with its seed argument, a runner setting — not a sentence about it. It is quoted verbatim into the failure message.

What it does not flag

  • A non-constant snippet.
  • A test asserting the rejection, where the call is the whole body of a lambda argument. JustDummies.PropertyTests asserts exactly this guard.

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