XBullet.EasyTesting.Snapshots.Core
1.3.0
dotnet add package XBullet.EasyTesting.Snapshots.Core --version 1.3.0
NuGet\Install-Package XBullet.EasyTesting.Snapshots.Core -Version 1.3.0
<PackageReference Include="XBullet.EasyTesting.Snapshots.Core" Version="1.3.0" />
<PackageVersion Include="XBullet.EasyTesting.Snapshots.Core" Version="1.3.0" />
<PackageReference Include="XBullet.EasyTesting.Snapshots.Core" />
paket add XBullet.EasyTesting.Snapshots.Core --version 1.3.0
#r "nuget: XBullet.EasyTesting.Snapshots.Core, 1.3.0"
#:package XBullet.EasyTesting.Snapshots.Core@1.3.0
#addin nuget:?package=XBullet.EasyTesting.Snapshots.Core&version=1.3.0
#tool nuget:?package=XBullet.EasyTesting.Snapshots.Core&version=1.3.0
XBullet.EasyTesting.Snapshots.Core
Framework-independent snapshot assertions for serializable values, raw JSON, plain text, HTTP content, controller responses, and complete request/response exchanges.
The package targets .NET 8, .NET 9, and .NET 10. It does not depend on xUnit, Verify,
XBullet.EasyTesting, ASP.NET testing, or XBullet.EasyTesting.Http.
Install
dotnet add package XBullet.EasyTesting.Snapshots.Core
Use XBullet.EasyTesting.Snapshots.Http instead when the test snapshots requests or exchanges
captured by StubHttpMessageHandler. Existing references to XBullet.EasyTesting.Snapshots can
remain temporarily through the compatibility facade.
Example
Import XBullet.EasyTesting.Snapshots to assert values and anonymous arrays directly:
using XBullet.EasyTesting.Snapshots;
await new[] { new { PortfolioCode = primaryPortfolioCode, Request = request } }
.ShouldMatchSnapshot("external-status-request", cancellationToken: cancellationToken);
The string selects a snapshot variant within the calling test. Omit it for a single snapshot, or
pass settings or a configureSnapshot callback to customize serialization and scrubbing.
var settings = new SnapshotSettings()
.Named("administrator-order")
.ScrubMembers("Id", "CreatedAt")
.IgnoreMember("AccessToken")
.ScrubGuids();
await SnapshotAssert.MatchAsync(result, settings, cancellationToken);
The first verification failure writes a target-framework-qualified *.received.* file. Review it,
ensure dynamic and sensitive values are handled, and promote it to the shared *.verified.* file.
Commit verified files; do not commit received files.
Controller and complete TestServer exchange assertions use the same settings:
await response.ShouldMatchControllerSnapshot(
snapshotSettings: settings,
cancellationToken: cancellationToken);
await response.ShouldMatchHttpExchangeSnapshot(
configureSnapshot: settings => settings.ScrubMember("id"),
cancellationToken: cancellationToken);
Snapshot assertions also continue to accept prebuilt SnapshotSettings instances.
Use .NormalizeStringLineEndings() on snapshot settings when JSON string values contain
platform-specific newlines, such as validation messages generated on Windows and Linux. This
opt-in rule converts decoded CRLF and CR to LF in both actual and verified JSON without rewriting
existing verified files. It preserves trailing newlines within values and literal backslash
sequences, and works with reusable or global defaults. HTTP text and YAML output retain their
existing behavior. See stabilizing snapshot data.
Attach HttpExchangeRecorder to the real client pipeline when the complete request body must be
captured before TestServer consumes it. Recorded responses accept configureExchange and separate
exchangeOptions during assertion to omit or further scrub captured data and select output format.
Callbacks start from independent recorder options; the original recording remains unchanged.
Data excluded or redacted during capture cannot be restored. See
where to configure exchange options.
Safety and maintenance
- Common sensitive HTTP headers and query values are excluded or redacted by default, but application-specific secrets still require explicit rules.
SnapshotUpdateMode.Allcan replace reviewed files. Never enable it in ordinary CI.- CI updates require a separate explicit authorization.
- Bulk acceptance and deletion require
confirmed: true; preview paths first. - Obsolete-file detection is valid only after the complete intended test scope passes.
Documentation
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. 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
- No dependencies.
-
net8.0
- No dependencies.
-
net9.0
- No dependencies.
NuGet packages (3)
Showing the top 3 NuGet packages that depend on XBullet.EasyTesting.Snapshots.Core:
| Package | Downloads |
|---|---|
|
XBullet.EasyTesting.Snapshots
Compatibility facade for the split snapshot core and outbound HTTP adapter packages. |
|
|
XBullet.EasyTesting.Verify.Xunit
Verify.XunitV3 snapshot support for XBullet.EasyTesting controller responses. |
|
|
XBullet.EasyTesting.Snapshots.Http
Snapshot adapters for XBullet.EasyTesting HTTP stubs and hosted scenario exchanges. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.3.0 | 47 | 10/22/2026 |
| 1.2.1 | 70 | 10/21/2026 |
| 1.1.0 | 137 | 10/10/2026 |
| 1.0.19 | 144 | 10/5/2026 |
| 1.0.18 | 148 | 10/4/2026 |
| 1.0.17 | 144 | 10/1/2026 |
| 1.0.16 | 148 | 9/30/2026 |
| 1.0.15 | 141 | 9/29/2026 |
| 1.0.14 | 143 | 9/27/2026 |
| 1.0.13 | 141 | 9/26/2026 |
| 1.0.12 | 144 | 9/25/2026 |
| 1.0.11 | 143 | 9/24/2026 |
| 1.0.9 | 143 | 9/24/2026 |
| 1.0.8 | 147 | 9/21/2026 |
| 1.0.7 | 150 | 9/19/2026 |
| 1.0.6 | 152 | 9/18/2026 |
| 1.0.5 | 148 | 9/18/2026 |