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

The core of Nullean.Snapshots, structural snapshot tests for .NET: the snapshot store, accept modes, scrubbers, the line and tree differs and the failure messages. Tests normally use it through Nullean.Snapshots.AwesomeAssertions or a format package; reference it directly to configure scrubbers or to build your own assertion.
Install
dotnet add package Nullean.Snapshots
Quick start
Scrub volatile values for every snapshot, once, before tests run, and build an assertion on the store:
using System.Runtime.CompilerServices;
using Nullean.Snapshots;
internal static class SnapshotSetup
{
[ModuleInitializer]
internal static void Init()
{
SnapshotDefaults.AddScrubber(Scrubbers.Guids); // Guid_1, Guid_2, ...
SnapshotDefaults.AddScrubber(Scrubbers.DateTimes); // DateTime_1, ...
}
}
public static class MyAssertions
{
// Your own assertion on top of the store: the key comes from the call site.
public static void MatchMySnapshot(
this string actual,
[CallerFilePath] string file = "",
[CallerMemberName] string member = "",
[CallerLineNumber] int line = 0)
{
var result = Snapshot.Match(actual, SnapshotFormats.Text, new SnapshotCallSite(file, member, line));
if (!result.Passed)
throw new InvalidOperationException(result.FailureMessage);
}
}
How it behaves
- A new snapshot fails: with no verified file the test fails and writes a received file. Accept it with
snap accept <key>(theNullean.Snapshots.Clitool) after reading it. SNAPSHOT_ACCEPT=1accepts every mismatch in the run. WithCIset to1ortrueit is ignored, and the failure message says so.- Verified files:
.snapshots/<test file dir>/<Class>/<Method>[.<name>][.<argsHash>].verified.<ext>; commit them. Received files go to$(ArtifactsPath)/.snapshots/received/<Project>/..., elseobj/snapshots/received/. - No scrubber runs by default. Global scrubbers run before per-call ones
(
new SnapshotOptions().Scrub(regex, replacement)). - Text is stored as UTF-8 without BOM, LF endings and one trailing newline.
Learn more
- Documentation: https://snapshots.nullean.net
- Layout of snapshot files: https://snapshots.nullean.net/reference/layout/
- Options: https://snapshots.nullean.net/reference/options/
- Source and issues: https://github.com/nullean/snapshots
| 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. |
-
net10.0
- DiffPlex (>= 1.9.0)
- Nullean.ScopedFileSystem (>= 0.7.1)
- System.IO.Abstractions (>= 23.0.0)
NuGet packages (8)
Showing the top 5 NuGet packages that depend on Nullean.Snapshots:
| Package | Downloads |
|---|---|
|
Nullean.Snapshots.AwesomeAssertions
Snapshot assertions for AwesomeAssertions: value.Should().MatchSnapshot(). |
|
|
Nullean.Snapshots.TUnit
TUnit test identity for Nullean.Snapshots: the runtime class, method and arguments of the running test. |
|
|
Nullean.Snapshots.Html
HTML snapshots and inline HTML assertions for Nullean.Snapshots: pretty-printed with AngleSharp, compared structurally with AngleSharp.Diffing. |
|
|
Nullean.Snapshots.Json
JSON snapshots and inline JSON assertions for Nullean.Snapshots, compared as trees: key order ignored, numbers by value, differences by path. |
|
|
Nullean.Snapshots.Yaml
YAML snapshots and inline YAML assertions for Nullean.Snapshots: stored verbatim, compared as trees with the YAML 1.2 core schema, differences pointing at line and column. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.12.1 | 0 | 11/12/2026 |
| 0.12.0 | 0 | 11/12/2026 |
| 0.11.0 | 12 | 11/11/2026 |
| 0.10.1 | 68 | 11/11/2026 |
| 0.10.0 | 90 | 11/11/2026 |
| 0.9.0 | 57 | 11/11/2026 |
| 0.8.1 | 127 | 11/11/2026 |
| 0.8.0 | 133 | 11/11/2026 |
| 0.7.0 | 242 | 11/10/2026 |
| 0.6.0 | 281 | 11/5/2026 |
| 0.5.0 | 144 | 11/5/2026 |
| 0.4.0 | 597 | 11/5/2026 |
| 0.3.0 | 149 | 11/4/2026 |
| 0.2.0 | 481 | 11/3/2026 |
| 0.1.0 | 534 | 11/3/2026 |
| 0.1.0-alpha.1 | 82 | 11/3/2026 |