Nullean.Snapshots.TUnit 0.12.1

dotnet add package Nullean.Snapshots.TUnit --version 0.12.1
                    
NuGet\Install-Package Nullean.Snapshots.TUnit -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.TUnit" 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.TUnit" Version="0.12.1" />
                    
Directory.Packages.props
<PackageReference Include="Nullean.Snapshots.TUnit" />
                    
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.TUnit --version 0.12.1
                    
#r "nuget: Nullean.Snapshots.TUnit, 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.TUnit@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.TUnit&version=0.12.1
                    
Install as a Cake Addin
#tool nuget:?package=Nullean.Snapshots.TUnit&version=0.12.1
                    
Install as a Cake Tool

Nullean.Snapshots.TUnit

snapshots.

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.

NuGet

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 call TUnitTestIdentity.Register() from a [Before(Assembly)] hook.

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

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.12.1 0 11/12/2026
0.12.0 0 11/12/2026
0.11.0 17 11/11/2026
0.10.1 43 11/11/2026
0.10.0 64 11/11/2026
0.9.0 43 11/11/2026
0.8.1 159 11/11/2026
0.8.0 120 11/11/2026
0.7.0 213 11/10/2026
0.6.0 219 11/5/2026
0.5.0 78 11/5/2026
0.4.0 531 11/5/2026
0.3.0 80 11/4/2026
0.2.0 453 11/3/2026
0.1.0 508 11/3/2026
0.1.0-alpha.1 67 11/3/2026