ProtoTest.Rest
1.1.5
dotnet add package ProtoTest.Rest --version 1.1.5
NuGet\Install-Package ProtoTest.Rest -Version 1.1.5
<PackageReference Include="ProtoTest.Rest" Version="1.1.5" />
<PackageVersion Include="ProtoTest.Rest" Version="1.1.5" />
<PackageReference Include="ProtoTest.Rest" />
paket add ProtoTest.Rest --version 1.1.5
#r "nuget: ProtoTest.Rest, 1.1.5"
#:package ProtoTest.Rest@1.1.5
#addin nuget:?package=ProtoTest.Rest&version=1.1.5
#tool nuget:?package=ProtoTest.Rest&version=1.1.5
ProtoTest.Rest
REST requests that use the ProtoTest context, authentication and trace.
dotnet add package ProtoTest.Rest
// ExpectAsync asserts the response shape in the call; it is the same facade assertion.
using var response = await Proto.Context.Rest()
.GetAsync("/orders/{id}", new { id = 42 })
.ExpectAsync(new { id = 42, status = "active" });
// After the fact, or exact (every field must be mentioned):
response.Should.HaveHttpStatus(HttpStatusCode.OK)
.Should.MatchShape(new { id = 42, status = "active" });
var id = response.ReadRequired<int>("$.id"); // throws naming the route and path when missing
Includes
The request can use a named target when your application has more than one API. Authentication can also use information that was added to the test context during setup.
Requests and checks are added to the same test trace as the rest of the test. Optional collectors can report endpoint, OpenAPI and traffic coverage: the fields that arrived in responses but that no shape assertion mentioned.
Learn more
| 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. |
-
net10.0
- Microsoft.Extensions.Http (>= 10.0.12)
- ProtoTest.Core (>= 1.1.5)
- ProtoTest.Http (>= 1.1.5)
- ProtoTest.Json (>= 1.1.5)
-
net8.0
- Microsoft.Extensions.Http (>= 8.0.1)
- ProtoTest.Core (>= 1.1.5)
- ProtoTest.Http (>= 1.1.5)
- ProtoTest.Json (>= 1.1.5)
-
net9.0
- Microsoft.Extensions.Http (>= 9.0.20)
- ProtoTest.Core (>= 1.1.5)
- ProtoTest.Http (>= 1.1.5)
- ProtoTest.Json (>= 1.1.5)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on ProtoTest.Rest:
| Package | Downloads |
|---|---|
|
ProtoTest.OpenApi
OpenAPI contract coverage for ProtoTest REST tests. |
|
|
ProtoTest.WireMock
Fake HTTP services for ProtoTest suites, backed by WireMock.Net: per-test stubs, matched-request trace evidence and stub coverage. |
GitHub repositories
This package is not used by any popular GitHub repositories.