JustDummies.Xunit 1.0.0-preview.1

This is a prerelease version of JustDummies.Xunit.
dotnet add package JustDummies.Xunit --version 1.0.0-preview.1
                    
NuGet\Install-Package JustDummies.Xunit -Version 1.0.0-preview.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="JustDummies.Xunit" Version="1.0.0-preview.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="JustDummies.Xunit" Version="1.0.0-preview.1" />
                    
Directory.Packages.props
<PackageReference Include="JustDummies.Xunit" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add JustDummies.Xunit --version 1.0.0-preview.1
                    
#r "nuget: JustDummies.Xunit, 1.0.0-preview.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package JustDummies.Xunit@1.0.0-preview.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=JustDummies.Xunit&version=1.0.0-preview.1&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=JustDummies.Xunit&version=1.0.0-preview.1&prerelease
                    
Install as a Cake Tool

JustDummies.Xunit

The xUnit v3 companion of JustDummies. Mark a test [Reproducible] and its arbitrary values are drawn from a pinned seed — reported only when the test fails, so a red test names the exact seed to replay while a green one stays silent.

Why

JustDummies makes a run reproducible by wrapping the test body in a delegate:

[Fact]
public void Order_reference_is_accepted() {
    Any.Reproducibly(() => {
        string reference = Any.String().StartingWith("ORD-").WithLength(12).Generate();
        // ... act, assert ...
    });
}

That works on every test framework, and stays the portable form. This package removes the ceremony for xUnit v3:

[Fact, Reproducible]
public void Order_reference_is_accepted() {
    string reference = Any.String().StartingWith("ORD-").WithLength(12).Generate();
    // ... act, assert ...
}

Values still vary between runs — which is what surfaces a test secretly depending on one — but a failure is now recoverable even though the body was never wrapped in advance.

Replaying a failure

A failing test writes its seed to the test output:

[JustDummies] These arbitrary values were seeded with 1234. Reproduce this run with [Reproducible(Seed = 1234)].

Pin it to replay:

[Fact, Reproducible(Seed = 1234)]
public void Order_reference_is_accepted() { /* ... */ }

The same snippet is what a generation failure names, so a diagnostic never points at a call the test does not contain.

Where it applies

  • A test: [Fact, Reproducible] or [Theory, Reproducible].
  • A class: [Reproducible] on the class covers every test it declares.
  • A whole suite: [assembly: Reproducible].

The hooks run once per test case, so each case of a theory draws its own seed rather than sharing one with its siblings. When several levels apply, the most specific one wins for the duration of the test and the outer ones are restored after it — an assembly-wide [Reproducible] can pin the suite while one test replays a particular seed.

Notes

  • Values drawn from an explicit Any.WithSeed(...) context are unaffected: that context is isolated by design and does not draw from the ambient source this attribute pins.
  • The seed is pinned through Any.UseSeed(...), a public handle any test-framework adapter can use — this package holds no privileged access to JustDummies.
  • xUnit v3 only. On xUnit v2, NUnit, MSTest or anything else, use Any.Reproducibly(...): it is unaffected by this package and works everywhere.

Credits

The package icon is a crash-test dummy by Magnific, from Flaticon.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0-preview.1 49 8/7/2026