Nullean.Snapshots.Images.Assertions
0.12.1
dotnet add package Nullean.Snapshots.Images.Assertions --version 0.12.1
NuGet\Install-Package Nullean.Snapshots.Images.Assertions -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.Images.Assertions" 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.Images.Assertions" Version="0.12.1" />
<PackageReference Include="Nullean.Snapshots.Images.Assertions" />
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.Images.Assertions --version 0.12.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Nullean.Snapshots.Images.Assertions, 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.Images.Assertions@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.Images.Assertions&version=0.12.1
#tool nuget:?package=Nullean.Snapshots.Images.Assertions&version=0.12.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Nullean.Snapshots.Images.Assertions

AwesomeAssertions extensions for Nullean.Snapshots.Images: MatchImageSnapshot for PNG bytes and streams, compared by pixels with a diff image on failure.
Install
dotnet add package Nullean.Snapshots.Images.Assertions
Quick start
using AwesomeAssertions;
using Nullean.Snapshots.Images;
public class ChartTests
{
[Test]
public void Draws()
{
byte[] png = Chart.Render();
png.Should().MatchImageSnapshot(); // .verified.png, compared by pixels
png.Should().MatchImageSnapshot(new ImageSnapshotOptions { MaxDifferentRatio = 0.001 }, name: "tolerant");
}
}

On a mismatch the message gives the count, the share and the regions that differ, and points at the received image and its diff image, both in the received folder:
Image did not match snapshot: tests/App.Tests/.snapshots/ChartTests/Draws.verified.png
1,204 of 480,000 pixels differ (0.25%), 0 allowed; 36 anti-aliased pixel(s) left out
2 difference(s):
x 120-184, y 40-58 (65x19): 1,180 pixel(s)
x 610-613, y 402-405 (4x4): 24 pixel(s)
Received: .artifacts/.snapshots/received/App.Tests/ChartTests/Draws.received.png
Diff: .artifacts/.snapshots/received/App.Tests/ChartTests/Draws.received-diff.png
Learn more
- Documentation: https://snapshots.nullean.net
- Image snapshots: https://snapshots.nullean.net/formats/images/
- 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. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net10.0
- Nullean.Snapshots.AwesomeAssertions (>= 0.12.1)
- Nullean.Snapshots.Images (>= 0.12.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.