Krumb.MockingToolbox
0.1.5
dotnet add package Krumb.MockingToolbox --version 0.1.5
NuGet\Install-Package Krumb.MockingToolbox -Version 0.1.5
<PackageReference Include="Krumb.MockingToolbox" Version="0.1.5" />
<PackageVersion Include="Krumb.MockingToolbox" Version="0.1.5" />
<PackageReference Include="Krumb.MockingToolbox" />
paket add Krumb.MockingToolbox --version 0.1.5
#r "nuget: Krumb.MockingToolbox, 0.1.5"
#:package Krumb.MockingToolbox@0.1.5
#addin nuget:?package=Krumb.MockingToolbox&version=0.1.5
#tool nuget:?package=Krumb.MockingToolbox&version=0.1.5
Krumb.MockingToolbox
A web dashboard for mocking outgoing HTTP calls from typed HttpClients in ASP.NET Core apps during testing.
Point it at any app using IHttpClientFactory and it automatically discovers every outgoing call, lets testers mock specific endpoints (with per-id targeting, scenarios, and a global kill switch) from a web dashboard, and requires zero code changes to the calling code itself.
Features
- Zero-touch discovery - a global
IHttpMessageHandlerBuilderFilterauto-wires every registeredHttpClient. No attributes, no per-client opt-in required. - Per-endpoint, per-id mocking - mock
GET /orders/{id}for every id, or just id123, independently. - Scenarios - bundle multiple mocks into a named preset ("Payment provider down"). Activating one snapshots and restores every other mock's state automatically.
- Global kill switch - disable all mocking instantly from the dashboard, without a redeploy, and it survives an app restart.
- Staleness tracking - endpoints not seen in a configurable window get flagged, so stale mocks don't silently rot.
Install
The core package works standalone out of the box, using a built-in in-memory store - good for a quick trial, but state is lost on every restart and it doesn't work correctly across multiple app instances (each keeps its own disconnected state). For anything beyond a quick local trial, install a storage provider:
- Krumb.MockingToolbox.EntityFrameworkCore.PostgreSql - recommended for most users. Self-contained, migrations pre-baked in, zero EF tooling required in your app.
- Krumb.MockingToolbox.EntityFrameworkCore - provider-agnostic, bring your own database and manage your own migrations.
Quick start (zero-config, in-memory)
services.AddMockingToolbox(options =>
{
options.IsEnabled = environment.IsDevelopment();
options.DashboardPath = "/mocking";
});
app.UseMockingToolbox();
That's a complete working setup - no storage package needed. State resets on every restart, which is fine for a quick local trial but not for a shared/persistent setup - see "Install" above for the recommended next step.
Quick start (PostgreSQL)
services.AddMockingToolbox(options =>
{
options.IsEnabled = environment.IsDevelopment() || environment.IsStaging();
options.DashboardPath = "/mocking";
options.UsePostgreSql(connectionString);
});
app.UseMockingToolbox();
That's it. Every AddHttpClient<...>() registration in the app is wired automatically. Open /mocking to see every discovered endpoint and start mocking.
Documentation
Full source and configuration reference: GitHub repository.
| 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 was computed. 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. |
-
net8.0
- No dependencies.
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Krumb.MockingToolbox:
| Package | Downloads |
|---|---|
|
Krumb.MockingToolbox.EntityFrameworkCore
Provider-agnostic Entity Framework Core storage for Krumb.MockingToolbox. Bring your own database provider - you generate and own your migrations. Prefer Krumb.MockingToolbox.EntityFrameworkCore.PostgreSql if you're on PostgreSQL for a zero-migration-tooling setup. |
GitHub repositories
This package is not used by any popular GitHub repositories.