ProtoTest.WireMock
1.1.1
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package ProtoTest.WireMock --version 1.1.1
NuGet\Install-Package ProtoTest.WireMock -Version 1.1.1
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="ProtoTest.WireMock" Version="1.1.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ProtoTest.WireMock" Version="1.1.1" />
<PackageReference Include="ProtoTest.WireMock" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add ProtoTest.WireMock --version 1.1.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: ProtoTest.WireMock, 1.1.1"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package ProtoTest.WireMock@1.1.1
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=ProtoTest.WireMock&version=1.1.1
#tool nuget:?package=ProtoTest.WireMock&version=1.1.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
ProtoTest.WireMock
Preview: the surface can change before 1.2.
Fake HTTP services for ProtoTest suites, backed by WireMock.Net: stub a dependency per test, read the matched requests in the trace with the REST response shape, and cover the stubs.
dotnet add package ProtoTest.WireMock
builder.AddWireMock("Payments");
var fake = Proto.Context.WireMock("Payments");
fake.Stub("GET", "/balance/*").RespondJson(HttpStatusCode.OK, new { available = 1200 });
// point the system under test at fake.BaseUrl, then act and assert on it
fake.VerifyNoUnmatchedRequests();
Includes
AddWireMock(name)registration;Proto.Context.WireMock(name)starts the fake on first use.- Per-test servers by default;
PerRun()shares one server, its stubs and its request log across the run (cleared byReset()or the run's release);Port(n)listens on a fixed port. - Stubbing through
Stub(method, path)withRespondWith/RespondJson, plus the rawGiven/Serverescape hatches for matchers the facade does not cover. - Matched requests traced as
http.responseobservations with the REST response payload; unmatched requests ashttp.failure, so they never count as covered. - A
WireMockcoverage collector, registered automatically per fake: registered stubs are gaps until a matched request covers them.
Limits
- HTTP only: the fake serves stubbed HTTP responses; it does not proxy, record, or validate against an OpenAPI document.
- Response headers are whatever WireMock logs for the entry, usually empty; the status, body and request URL are always recorded, with the shared HTTP redaction applied.
- A per-run fake is shared: its stubs and request log live for the whole run, parallel tests share
the log, and observations are attributed to the test whose teardown observed them. Call
Reset()to clear the shared fake between tests. - A fixed-port fake cannot be shared by parallel tests.
- The server stops with its owner (the test, or the run); assert
ReceivedCountandReceivedRequestsbefore the test completes.
Learn more
- WireMock fakes
- REST (the observation shapes fakes reuse)
- Coverage
| 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. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net10.0
- Humanizer (>= 3.0.10)
- ProtoTest.Core (>= 1.1.1)
- ProtoTest.Http (>= 1.1.1)
- ProtoTest.Rest (>= 1.1.1)
- WireMock.Net (>= 2.18.0)
-
net8.0
- Humanizer (>= 3.0.10)
- ProtoTest.Core (>= 1.1.1)
- ProtoTest.Http (>= 1.1.1)
- ProtoTest.Rest (>= 1.1.1)
- WireMock.Net (>= 2.18.0)
-
net9.0
- Humanizer (>= 3.0.10)
- ProtoTest.Core (>= 1.1.1)
- ProtoTest.Http (>= 1.1.1)
- ProtoTest.Rest (>= 1.1.1)
- WireMock.Net (>= 2.18.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.