| Property | Value |
|---|---|
| Category | Reproducibility (JustDummies.Reproducibility) |
| Severity | 🟠 Warning |
| Enabled by default | Yes |
Both mechanisms report a replay instruction, and nesting makes the outer one false.
Any.Reproducibly takes its seed from Guid.NewGuid().GetHashCode() — not from the ambient source — so an inner scope ignores whatever the outer one pinned and draws afresh on every run. The outer runner, or [Reproducible], still reports its seed. The failure therefore says “reproduce this run with seed N”, and replaying with N reproduces nothing.
That is a wrong instruction rather than a wrong result, which is what makes it worth reporting: the reader trusts it and loses time before doubting it.
Noncompliant
[Fact, Reproducible]
public void It_is_accepted() {
Any.Reproducibly(() => { /* ... */ }); // JD018: the attribute's seed governs nothing in here
}
Compliant
[Fact, Reproducible]
public void It_is_accepted() {
/* ... */ // the attribute already pins the whole test
}
What it does not flag
- The seeded overload —
Any.Reproducibly(1234, ...). Pinning a chosen seed inside is deliberate, and the reader who wrote it knows which seed governs what. - A lone runner in a test that carries no
[Reproducible].