Conjecture.Http
0.29.0
dotnet add package Conjecture.Http --version 0.29.0
NuGet\Install-Package Conjecture.Http -Version 0.29.0
<PackageReference Include="Conjecture.Http" Version="0.29.0" />
<PackageVersion Include="Conjecture.Http" Version="0.29.0" />
<PackageReference Include="Conjecture.Http" />
paket add Conjecture.Http --version 0.29.0
#r "nuget: Conjecture.Http, 0.29.0"
#:package Conjecture.Http@0.29.0
#addin nuget:?package=Conjecture.Http&version=0.29.0
#tool nuget:?package=Conjecture.Http&version=0.29.0
Conjecture.Http
HTTP interaction primitives for Conjecture. Defines HttpInteraction (a serializable description of an HTTP call) and IHttpTarget (resolves an HttpClient per named resource) so you can write transport-agnostic property tests over HTTP services.
Install
dotnet add package Conjecture.Core
dotnet add package Conjecture.Http
Usage
using Conjecture.Core;
using Conjecture.Http;
using Conjecture.Xunit;
public class ApiTests
{
[Property]
public async Task NeverReturns5xx(HttpInteraction request)
{
Strategy<HttpInteraction> strategy = Strategy.Http("api")
.Get("/items/{id}")
.Build();
await strategy.Sample().Response(target).AssertNot5xx();
}
}
HostHttpTarget wraps an IHost (e.g. a WebApplicationFactory) so requests dispatch in-process. Compose HttpInteraction strategies with Conjecture.AspNetCore to derive valid and malformed requests directly from minimal-API and MVC route metadata.
Types
| Type | Role |
|---|---|
HttpInteraction |
Readonly record: method, path, headers, body, named resource. |
IHttpTarget |
Resolves an HttpClient for a named resource. |
HostHttpTarget |
IHttpTarget over an IHost / WebApplicationFactory. |
HttpStrategyBuilder |
Fluent builder for HttpInteraction strategies — Strategy.Http(resource).Get/Post/Put/Delete/Patch(...).Build(). |
HttpInvariantExtensions |
AssertNot5xx, Assert4xx, AssertProblemDetailsShape, Response(target). |
Links
| 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. |
-
net10.0
- Conjecture.Core (>= 0.29.0)
- Conjecture.Interactions.Abstractions (>= 0.29.0)
- Microsoft.Extensions.Hosting (>= 10.0.7)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Conjecture.Http:
| Package | Downloads |
|---|---|
|
Conjecture.AspNetCore
Property-based testing for ASP.NET Core minimal APIs and MVC controllers via metadata-driven request synthesis. |
GitHub repositories
This package is not used by any popular GitHub repositories.