Anarchy.Toolkit.Testing.Runtime.Web 1.0.0

dotnet add package Anarchy.Toolkit.Testing.Runtime.Web --version 1.0.0
                    
NuGet\Install-Package Anarchy.Toolkit.Testing.Runtime.Web -Version 1.0.0
                    
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="Anarchy.Toolkit.Testing.Runtime.Web" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Anarchy.Toolkit.Testing.Runtime.Web" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Anarchy.Toolkit.Testing.Runtime.Web" />
                    
Project file
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 Anarchy.Toolkit.Testing.Runtime.Web --version 1.0.0
                    
#r "nuget: Anarchy.Toolkit.Testing.Runtime.Web, 1.0.0"
                    
#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 Anarchy.Toolkit.Testing.Runtime.Web@1.0.0
                    
#: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=Anarchy.Toolkit.Testing.Runtime.Web&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Anarchy.Toolkit.Testing.Runtime.Web&version=1.0.0
                    
Install as a Cake Tool

Anarchy.Toolkit.Testing.Runtime.Web

Part of Anarchy I/O Toolkit, a .NET developer platform · Pillar: Infrastructure · Layer: Testing kit · Package catalog

Test helpers for REST APIs using the toolkit's web pipeline.

dotnet add package Anarchy.Toolkit.Testing.Runtime.Web
  • Derive from RestApiTestCaseBase<TStartup, TAppSettings> to exercise the native request pipeline; AwsRestApiTestCaseBase in Anarchy.Toolkit.Testing.Runtime.Web.Aws adds the AWS Lambda pipeline.
  • MockAuthorizationToken<TAppSettings>(scopes) helps with authorization scenarios.
  • The test bases accept any IAppSettings; they add the mock bearer token only when the settings implement IAuthServiceAppSettings, so APIs without authentication can use them too.
  • Use the shared Testing package for fixtures and assertions.

When to use it

Use this package for API tests that need to exercise routing, middleware, authentication and response serialization through the toolkit's native ASP.NET Core pipeline (and, with Testing.Runtime.Web.Aws, the Lambda one). It complements unit tests; external dependencies still need appropriate test implementations or isolated infrastructure.

How to use it

  1. Derive a test class from RestApiTestCaseBase<TStartup, TAppSettings>, supplying a WebApplicationFactory<TStartup> and the application's authorization scopes. The settings type must implement IAuthServiceAppSettings.
  2. Build requests with Get, Post, Put or Patch, and assert status and parsed output with the endpoint test methods. Configure embedded test settings and the mock token issuer for authenticated scenarios.
  3. Use TestEndpointAsync (or TestEndpointNativeAsync) to send a request and assert its status and output. With AwsRestApiTestCaseBase, TestEndpointAsync also runs the Lambda pipeline and compares both responses.

The runnable greeting API test shows the fixture constructor and a request assertion.

See the sample tests, testing conventions and toolkit overview.

Releases

See the release notes for the complete release history.

Product Compatible and additional computed target framework versions.
.NET 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.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Anarchy.Toolkit.Testing.Runtime.Web:

Package Downloads
Anarchy.Toolkit.Testing.Runtime.Web.Aws

AWS Lambda web test toolkit: AwsRestApiTestCaseBase exercising both the native Kestrel and AWS Lambda pipelines, a testable Lambda entry point, API Gateway request conversion and API Gateway response assertions.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0 54 11/27/2026

## Releases

### 1.0.0

- Renamed from `Anarchy.Toolkit.Testing.Web`, whose last release was 2.1.0; the releases below were published under that name.
- **Breaking:** extension classes take the `Extensions` suffix under `Extensions/<extended namespace>/`, helpers live in `Helpers/<Subject>/`, and their namespaces follow those folders: update `using` directives.
- The Lambda and API Gateway test paths move to `Anarchy.Toolkit.Testing.Runtime.Web.Aws` (`AwsRestApiTestCaseBase`), so this package references no AWS package.
- `RestApiTestCaseBase` accepts any `IAppSettings` and adds the mock bearer token only when the settings implement `IAuthServiceAppSettings`.

### 2.1.0

- Update dependencies for the persistence abstractions.

### 2.0.1

- fix(Web): Support Windows paths and host architecture
- chore(build): Format package release notes property

### 2.0.0

- feat(automation): establish onboarding and layering conventions
- feat(telemetry)!: introduce provider-neutral application telemetry
- refactor(packages)!: restructure persistence and automation packages
- refactor(infrastructure.correlationid)!: decouple correlation scopes from Serilog
- refactor(core)!: reshape telemetry, event and health contracts
- fix(persistence)!: preserve unit-of-work transaction ownership
- refactor(telemetry)!: remove legacy APIs and simplify namespaces
- feat(automation)!: configure layering and bridge build telemetry
- refactor(telemetry)!: update consumers and samples
- docs(onboarding): align package guidance, skills, and architecture

### 1.2.1

- docs(packages): identify each package's pillar and layer
- build(packages): attribute the copyright to Leandro Melão Medeiros
- build: relicense under Apache-2.0 and update the package metadata

### 1.2.0

- build(deps): upgrade Swashbuckle.AspNetCore to 11.0.1 and Microsoft.OpenApi to 3.11.1
- feat(Web): serve OpenAPI 3.2 and theme Swagger UI with a light and dark Anarchy theme

### 1.0.8

- docs: expand XML docblocks across all projects for the DocFX API reference

### 1.0.7

- References `Anarchy.Toolkit.Web` 1.0.7, aligned with the .NET 10 LTS.

### 1.0.6

- refactor(src): clean up code style across library packages
- chore(deps): update AWS SDK, Lambda ASP.NET Core server and MySqlConnector packages

### 1.0.5

- chore(deps): update AWS SDK packages

### 1.0.3

- build: migrate local automation to build tooling

### 1.0.2

- docs: expand package guides and release histories
- chore(deps): update AWS, Polly, and xUnit packages

### 1.0.1

- Added a package-specific NuGet README.

### 1.0.0

- Introduced REST API test bases, a testable Lambda entry point and HTTP request helpers.