Nullean.Snapshots.TUnit
0.18.0
dotnet add package Nullean.Snapshots.TUnit --version 0.18.0
NuGet\Install-Package Nullean.Snapshots.TUnit -Version 0.18.0
<PackageReference Include="Nullean.Snapshots.TUnit" Version="0.18.0" />
<PackageVersion Include="Nullean.Snapshots.TUnit" Version="0.18.0" />
<PackageReference Include="Nullean.Snapshots.TUnit" />
paket add Nullean.Snapshots.TUnit --version 0.18.0
#r "nuget: Nullean.Snapshots.TUnit, 0.18.0"
#:package Nullean.Snapshots.TUnit@0.18.0
#addin nuget:?package=Nullean.Snapshots.TUnit&version=0.18.0
#tool nuget:?package=Nullean.Snapshots.TUnit&version=0.18.0
Nullean.Snapshots.TUnit

TUnit test identity for Nullean.Snapshots: snapshot names come from the running test's runtime class, method and arguments, so every case of a data-driven test gets its own file. Adds the [SnapshotFiles], [JourneyFiles] and [HttpFiles] data sources.
Install
dotnet add package Nullean.Snapshots.TUnit
Quick start
Reference it from every TUnit test project that asserts snapshots; a buildTransitive targets file registers it, so there is nothing to call.
using AwesomeAssertions;
using Nullean.Snapshots;
using Nullean.Snapshots.TUnit;
public class RenderTests
{
[Test]
[Arguments("kibana")]
[Arguments("beats")]
public void Renders(string product) =>
Catalog.Greet(product).Should().MatchSnapshot(); // Renders.<argsHash>.verified.txt per case
[Test]
[SnapshotFiles("cases", "*.md")] // one case per file: Formats(nested/case)
public void Formats(SnapshotFile file)
{
var result = Snapshot.MatchFile(File.ReadAllText(file.Path).ToUpperInvariant(), SnapshotFormats.Text, file.Path);
if (!result.Passed)
Assert.Fail(result.FailureMessage!);
}
}
- Without this package the class folder is the test file name and arguments add no hash, so every case of a data-driven test shares one verified file.
- The hash is of each argument's invariant text. Use records or primitives: a class without a
ToString()override hashes the same for every case and fails, asking for a name. - The folder is the runtime class, so
[InheritsTests]classes get their own snapshots. - To register by hand, set
<SnapshotsTUnitAutoRegister>false</SnapshotsTUnitAutoRegister>and callTUnitTestIdentity.Register()from a[Before(Assembly)]hook.
Learn more
- Documentation: https://snapshots.nullean.net
- Layout of snapshot files: https://snapshots.nullean.net/reference/layout/
- Source and issues: https://github.com/nullean/snapshots
Partial runs
A test process started with a filter (--treenode-filter, --filter-uid, --filter) marks its run manifest partial, and so does a journey or .http file skipped by SkipReason. snap orphans then skips the project instead of reporting every untouched snapshot as an orphan. A runner that selects tests another way calls SnapshotDefaults.MarkRunPartial(reason).
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. 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. net11.0 is compatible. |
-
net10.0
- Nullean.Snapshots (>= 0.18.0)
- TUnit.Core (>= 1.83.8)
-
net11.0
- Nullean.Snapshots (>= 0.18.0)
- TUnit.Core (>= 1.83.8)
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 |
|---|---|---|
| 0.18.0 | 355 | 11/17/2026 |
| 0.17.0 | 103 | 11/17/2026 |
| 0.16.0 | 95 | 11/16/2026 |
| 0.15.0 | 257 | 11/16/2026 |
| 0.14.0 | 188 | 11/15/2026 |
| 0.13.0 | 100 | 11/14/2026 |
| 0.12.2 | 156 | 11/14/2026 |
| 0.12.1 | 150 | 11/12/2026 |
| 0.12.0 | 215 | 11/12/2026 |
| 0.11.0 | 375 | 11/11/2026 |
| 0.10.1 | 133 | 11/11/2026 |
| 0.10.0 | 117 | 11/11/2026 |
| 0.9.0 | 92 | 11/11/2026 |
| 0.8.1 | 254 | 11/11/2026 |
| 0.8.0 | 167 | 11/11/2026 |
| 0.7.0 | 234 | 11/10/2026 |
| 0.6.0 | 232 | 11/5/2026 |
| 0.5.0 | 89 | 11/5/2026 |
| 0.4.0 | 544 | 11/5/2026 |
| 0.3.0 | 90 | 11/4/2026 |