Nullean.Snapshots 0.12.1

dotnet add package Nullean.Snapshots --version 0.12.1
                    
NuGet\Install-Package Nullean.Snapshots -Version 0.12.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="Nullean.Snapshots" Version="0.12.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Nullean.Snapshots" Version="0.12.1" />
                    
Directory.Packages.props
<PackageReference Include="Nullean.Snapshots" />
                    
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 Nullean.Snapshots --version 0.12.1
                    
#r "nuget: Nullean.Snapshots, 0.12.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 Nullean.Snapshots@0.12.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=Nullean.Snapshots&version=0.12.1
                    
Install as a Cake Addin
#tool nuget:?package=Nullean.Snapshots&version=0.12.1
                    
Install as a Cake Tool

Nullean.Snapshots

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.

NuGet

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> (the Nullean.Snapshots.Cli tool) after reading it.
  • SNAPSHOT_ACCEPT=1 accepts every mismatch in the run. With CI set to 1 or true it 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>/..., else obj/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

Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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