![]() |
VOOZH | about |
dotnet add package Rig.TUnit.Http --version 0.1.0-beta.2
NuGet\Install-Package Rig.TUnit.Http -Version 0.1.0-beta.2
<PackageReference Include="Rig.TUnit.Http" Version="0.1.0-beta.2" />
<PackageVersion Include="Rig.TUnit.Http" Version="0.1.0-beta.2" />Directory.Packages.props
<PackageReference Include="Rig.TUnit.Http" />Project file
paket add Rig.TUnit.Http --version 0.1.0-beta.2
#r "nuget: Rig.TUnit.Http, 0.1.0-beta.2"
#:package Rig.TUnit.Http@0.1.0-beta.2
#addin nuget:?package=Rig.TUnit.Http&version=0.1.0-beta.2&prereleaseInstall as a Cake Addin
#tool nuget:?package=Rig.TUnit.Http&version=0.1.0-beta.2&prereleaseInstall as a Cake Tool
In-memory HTTP mock with matcher matrix, response builders, scenario state machine, delay / jitter / failure injection, and record/replay.
A rich in-memory HTTP mock. Supports:
mock.Verify(method, path).Called(N).Every setup must end with .And() so the fluent chain materialises
into the mock.
WebApplicationFactory.HttpClient with an injected HttpMessageHandler or
named IHttpClientFactory registration.using Rig.TUnit.Http;
using System.Net;
var mock = new HttpMock();
mock.When.Post().Path("/orders")
.JsonPathEquals("customer.id", "c-1")
.Responds()
.WithStatus(HttpStatusCode.Created)
.WithJson("{\"id\":42}")
.And();
var client = mock.CreateClient();
| Property | Type | Default | Description |
|---|---|---|---|
DefaultBaseAddress |
Uri |
new Uri("http://mock") |
Base URI for CreateClient |
StrictMatching |
bool |
true |
Fail on request with no matching setup |
CaseSensitiveHeaders |
bool |
false |
Match headers case-insensitively per HTTP spec |
Rig.TUnit.Http.HttpMockRig.TUnit.Http.Builders.HttpMockSetupBuilderRig.TUnit.Http.Builders.HttpMockResponseBuilderRig.TUnit.Http.Helpers.HttpMockRecorderEach HttpMock instance is scoped. No shared state; parallel tests
each own their mock. Safe under full parallelism.
.And() terminator.
Every setup chain must end with .And() to register.UnmatchedRequestException — a request arrived with no matching
setup. Either add a matcher or disable StrictMatching.HttpMock.RecordAgainst(handler)
must be called BEFORE the test's HTTP calls; recording a completed
exchange log is not supported.See .
mock.Reset(); between tests is
implicit (each test owns its mock).System.Text.Json evaluator — it accepts
a narrower subset than Newtonsoft.Json's JSONPath; stick to basic
dotted-path + array-index forms.TimeProvider; freeze time via
FakeTimeProvider for deterministic retry-policy tests.See ;
baseline in benchmarks/baseline-005.json.
MIT. See .
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 net10.0 is compatible. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
Showing the top 2 NuGet packages that depend on Rig.TUnit.Http:
| Package | Downloads |
|---|---|
|
Rig.TUnit.Microservices.Contracts
TUnit fixture for consumer-driven contract tests - Pact-friendly helpers and contract-drift assertions. |
|
|
Rig.TUnit.All
Meta-package containing every Rig.TUnit.* package. DISCOURAGED — prefer per-feature or per-stack meta-packages (Rig.TUnit, Rig.TUnit.Microservices). |
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.1.0-beta.2 | 66 | 4/27/2026 |
| 0.0.0-alpha.0.14 | 65 | 4/26/2026 |