XBullet.EasyTesting.Verify.Xunit
1.0.13
dotnet add package XBullet.EasyTesting.Verify.Xunit --version 1.0.13
NuGet\Install-Package XBullet.EasyTesting.Verify.Xunit -Version 1.0.13
<PackageReference Include="XBullet.EasyTesting.Verify.Xunit" Version="1.0.13" />
<PackageVersion Include="XBullet.EasyTesting.Verify.Xunit" Version="1.0.13" />
<PackageReference Include="XBullet.EasyTesting.Verify.Xunit" />
paket add XBullet.EasyTesting.Verify.Xunit --version 1.0.13
#r "nuget: XBullet.EasyTesting.Verify.Xunit, 1.0.13"
#:package XBullet.EasyTesting.Verify.Xunit@1.0.13
#addin nuget:?package=XBullet.EasyTesting.Verify.Xunit&version=1.0.13
#tool nuget:?package=XBullet.EasyTesting.Verify.Xunit&version=1.0.13
XBullet.EasyTesting.Verify.Xunit
Optional Verify.Xunit v3 integration for snapshot-testing HTTP controller responses produced by XBullet.EasyTesting.
The package targets .NET 8, .NET 9, and .NET 10.
Install
dotnet add package XBullet.EasyTesting.Verify.Xunit
Example
[Fact]
public async Task Get_order_matches_snapshot()
{
using var response = await client.GetAsync("/api/orders/42");
await response.VerifyControllerSnapshot();
}
The verified model contains stable request, status, header, and body data. Volatile headers are excluded by default, and ControllerSnapshotOptions can customize the captured result.
For a complete request/response exchange, attach an HttpExchangeRecorder to the test client.
This records the real TestServer call; it does not replace the transport with a stub:
[Fact]
public async Task Create_product_matches_complete_exchange()
{
var options = new HttpExchangeSnapshotOptions();
options.Response.IgnoringHeaders("Location");
var recorder = new HttpExchangeRecorder(options);
using var client = scope.Client()
.AsUser(user => user.WithName("snapshot tester"))
.WithHandler(recorder)
.Build();
using var response = await client.PostAsJsonAsync(
"/api/products",
new { name = "Webcam", price = 79.95m });
var settings = new VerifySettings();
settings.ScrubMember("id");
await response.VerifyHttpExchangeSnapshot(settings: settings);
}
The recorder associates the pre-transport capture with the returned response, so a factory or
client helper can attach a fresh recorder while tests use only the response extension. Without a
recorder, the extension falls back to the request retained by HttpResponseMessage. Use
recorder.VerifyHttpExchangesSnapshot(settings) when the verified file should contain an array of
every exchange in request order.
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
- Verify.XunitV3 (>= 31.24.0)
- XBullet.EasyTesting.Snapshots.Core (>= 1.0.13)
-
net8.0
- Verify.XunitV3 (>= 31.24.0)
- XBullet.EasyTesting.Snapshots.Core (>= 1.0.13)
-
net9.0
- Verify.XunitV3 (>= 31.24.0)
- XBullet.EasyTesting.Snapshots.Core (>= 1.0.13)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.