aweXpect.Web
4.0.0-pre.1
Prefix Reserved
See the version list below for details.
dotnet add package aweXpect.Web --version 4.0.0-pre.1
NuGet\Install-Package aweXpect.Web -Version 4.0.0-pre.1
<PackageReference Include="aweXpect.Web" Version="4.0.0-pre.1" />
<PackageVersion Include="aweXpect.Web" Version="4.0.0-pre.1" />
<PackageReference Include="aweXpect.Web" />
paket add aweXpect.Web --version 4.0.0-pre.1
#r "nuget: aweXpect.Web, 4.0.0-pre.1"
#:package aweXpect.Web@4.0.0-pre.1
#addin nuget:?package=aweXpect.Web&version=4.0.0-pre.1&prerelease
#tool nuget:?package=aweXpect.Web&version=4.0.0-pre.1&prerelease
aweXpect.Web
aweXpect.Web contains expectations for HttpRequestMessage,
HttpResponseMessage, Uri and IPAddress, e.g. to verify the responses of an HttpClient.
At a glance
HttpResponseMessage response = await httpClient.GetAsync("https://music.example.com/tracks/1");
// verify the status code, either the exact value or its category
await Expect.That(response).HasStatusCode().Success();
// verify the media type and the headers of the response
await Expect.That(response).HasContentType("application/json");
await Expect.That(response).HasHeader("Cache-Control").WithValue("must-revalidate, max-age=0, private");
// verify the content of the response
await Expect.That(response).HasContent("*Let It Be*").AsWildcard();
A failing expectation on a request or response includes the formatted HTTP request and response. If the test server
returned the track, HasStatusCode(HttpStatusCode.NotFound) would fail with:
Expected that response
has status code 404 NotFound,
but it had status code 200 OK
HTTP-Request:
GET http://localhost/tracks/1 HTTP/1.1
HTTP-Response:
200 OK HTTP/1.1
x-vendor: VENDOR
Content-Type: application/json; charset=utf-8
Content-Length: 51
{
"id": 1,
"title": "Let It Be",
"artist": "The Beatles"
}
Overview
Expectations for HttpRequestMessage:
| Expectation | Negated | Summary |
|---|---|---|
HasMethod |
DoesNotHaveMethod |
has the expected HTTP method |
HasRequestUri |
DoesNotHaveRequestUri |
has the expected request URI |
HasHeader |
DoesNotHaveHeader |
has a header, optionally with a value |
HasContent |
DoesNotHaveContent |
has the expected string content |
Expectations for HttpResponseMessage:
| Expectation | Negated | Summary |
|---|---|---|
HasStatusCode |
HasStatusCode().DifferentTo |
has the expected status code or status category |
HasHeader |
DoesNotHaveHeader |
has a header, optionally with a value |
HasContentType |
DoesNotHaveContentType |
has the expected media type |
HasContent |
DoesNotHaveContent |
has the expected string content |
HasProblemDetailsContent |
DoesNotComplyWith |
has a ProblemDetails content |
HasRequestMessage |
the request message meets nested expectations |
Expectations for Uri:
| Expectation | Negated | Summary |
|---|---|---|
IsAbsolute |
IsNotAbsolute |
an absolute URI |
IsFile |
IsNotFile |
a file URI |
IsLoopback |
IsNotLoopback |
references the local host |
IsUnc |
IsNotUnc |
a UNC path |
HasDefaultPort |
DoesNotHaveDefaultPort |
uses the default port of its scheme |
HasPort |
negated comparison | has the expected port |
HasScheme |
negated comparison | has the expected scheme |
HasHost |
negated comparison | has the expected host |
HasPath |
negated comparison | has the expected path |
HasFragment |
negated comparison | has the expected fragment |
IsBaseOf |
IsNotBaseOf |
a base URI of the expected URI |
HasQueryParameter |
DoesNotHaveQueryParameter |
has a query parameter, optionally with a value |
Expectations for IPAddress:
| Expectation | Negated | Summary |
|---|---|---|
IsIPv4 |
IsNotIPv4 |
an IPv4 address |
IsIPv6 |
IsNotIPv6 |
an IPv6 address |
IsLoopback |
IsNotLoopback |
a loopback address |
IsInSubnet |
IsNotInSubnet |
in the expected subnet |
IsEqualTo |
IsNotEqualTo |
equal to the expected address, optionally ignoring mapping |
Documentation
The full documentation is available at docs.testably.org:
- HTTP requests and responses: method, request URI, headers and content of an
HttpRequestMessage, and status code, headers, content type, content, problem details and the request message of anHttpResponseMessage - URIs: kind, port, scheme, host, path, fragment, base URI and query parameters of a
Uri - IP addresses: IPv4, IPv6, loopback, subnet membership and equality of an
IPAddress - Customization: formatting the request and response content in failure messages
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. 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 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. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- aweXpect.Core (>= 4.0.0-pre.1)
- System.Text.Json (>= 10.0.13)
-
net10.0
- aweXpect.Core (>= 4.0.0-pre.1)
-
net8.0
- aweXpect.Core (>= 4.0.0-pre.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 4.3.0 | 0 | 11/19/2026 |
| 4.2.0 | 63 | 11/15/2026 |
| 4.1.0 | 60 | 11/13/2026 |
| 4.0.0 | 98 | 11/10/2026 |
| 4.0.0-pre.4 | 62 | 11/6/2026 |
| 4.0.0-pre.3 | 75 | 10/29/2026 |
| 4.0.0-pre.2 | 68 | 10/27/2026 |
| 4.0.0-pre.1 | 68 | 10/22/2026 |
| 2.1.0 | 121 | 10/16/2026 |
| 2.0.0 | 102 | 10/10/2026 |
| 2.0.0-pre.2 | 68 | 10/8/2026 |
| 2.0.0-pre.1 | 76 | 9/28/2026 |
| 1.8.0 | 129 | 9/5/2026 |
| 1.7.0 | 138 | 5/10/2026 |
| 1.6.0 | 245 | 10/19/2025 |
| 1.4.0 | 243 | 9/10/2025 |
| 1.3.0 | 257 | 6/30/2025 |
| 1.2.0 | 171 | 5/10/2025 |
| 1.1.0 | 266 | 4/1/2025 |
| 1.0.0 | 241 | 3/19/2025 |