Vostra.Result.AspNetCore.Testing
1.2.1
dotnet add package Vostra.Result.AspNetCore.Testing --version 1.2.1
NuGet\Install-Package Vostra.Result.AspNetCore.Testing -Version 1.2.1
<PackageReference Include="Vostra.Result.AspNetCore.Testing" Version="1.2.1" />
<PackageVersion Include="Vostra.Result.AspNetCore.Testing" Version="1.2.1" />
<PackageReference Include="Vostra.Result.AspNetCore.Testing" />
paket add Vostra.Result.AspNetCore.Testing --version 1.2.1
#r "nuget: Vostra.Result.AspNetCore.Testing, 1.2.1"
#:package Vostra.Result.AspNetCore.Testing@1.2.1
#addin nuget:?package=Vostra.Result.AspNetCore.Testing&version=1.2.1
#tool nuget:?package=Vostra.Result.AspNetCore.Testing&version=1.2.1
Vostra.Result.AspNetCore.Testing
HTTP integration-testing toolkit for Vostra.Result. A
TestHttpClient collapses an HTTP round-trip into a Result<T>, rebuilding the typed error from the
Vostra.Result.AspNetCore RFC 7807 response so tests assert error identity, not substrings. It builds on
the transport-neutral chain-and-assert layer in
Vostra.Result.Testing.
The result: tests read like the domain script they're checking — no HTTP plumbing, no brittle
Content.Should().Contain("not found"), and a rich failure diagnostic when something actually breaks:
var api = new TestHttpClient(httpClient, baseUrl: "products");
// success: returns the value
var product = await api.Get<Product>("/7").ShouldBeSuccess();
// failure: typed-error assertion, no substring matching
await api.Get<Product>("/9").ShouldHaveError("Product.NotFound");
await api.Post<Product>("", invalid).ShouldBeValidation();
// lists
var page = await api.GetList<Product>().ShouldBeSuccess(); // page.Items / page.Pagination
- Fully async (no
.Result), verbs:Get/GetList/Post/Put/Patch/Delete(generic + valueless). - Errors rebuilt from RFC 7807
problem+jsoninto the matchingErrorBasekind, preservingCode. - Assertions (from
Vostra.Result.Testing) throw aVostraAssertionExceptionwith a rich diagnostic (verb, URL, request body, server error) composed only on failure. - Swap the serializer/envelope by implementing
IResultRawFormat(default:RawJsonFormat, System.Text.Json).
| 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 was computed. 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
- Vostra.Result.AspNetCore (>= 1.2.1)
- Vostra.Result.Testing (>= 1.2.1)
-
net8.0
- Vostra.Result.AspNetCore (>= 1.2.1)
- Vostra.Result.Testing (>= 1.2.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.