Anarchy.Toolkit.Testing.Web
1.1.0
See the version list below for details.
dotnet add package Anarchy.Toolkit.Testing.Web --version 1.1.0
NuGet\Install-Package Anarchy.Toolkit.Testing.Web -Version 1.1.0
<PackageReference Include="Anarchy.Toolkit.Testing.Web" Version="1.1.0" />
<PackageVersion Include="Anarchy.Toolkit.Testing.Web" Version="1.1.0" />
<PackageReference Include="Anarchy.Toolkit.Testing.Web" />
paket add Anarchy.Toolkit.Testing.Web --version 1.1.0
#r "nuget: Anarchy.Toolkit.Testing.Web, 1.1.0"
#:package Anarchy.Toolkit.Testing.Web@1.1.0
#addin nuget:?package=Anarchy.Toolkit.Testing.Web&version=1.1.0
#tool nuget:?package=Anarchy.Toolkit.Testing.Web&version=1.1.0
Anarchy.Toolkit.Testing.Web
Test helpers for REST APIs using the toolkit's web pipeline.
dotnet add package Anarchy.Toolkit.Testing.Web
- Derive from
RestApiTestCaseBase<TStartup, TAppSettings>to exercise native and AWS Lambda request pipelines. TestableLambdaEntrypointsupports Lambda-based tests;MockAuthorizationToken<TAppSettings>(scopes)helps with authorization scenarios.- 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 and Lambda hosting paths. It complements unit tests; external dependencies still need appropriate test implementations or isolated infrastructure.
How to use it
- Derive a test class from
RestApiTestCaseBase<TStartup, TAppSettings>, supplying aWebApplicationFactory<TStartup>, aTestableLambdaEntrypoint<TStartup>and the application's authorization scopes. The settings type must implementIAuthServiceAppSettings. - Build requests with
Get,Post,PutorPatch, and assert status and parsed output with the endpoint test methods. Configure embedded test settings and the mock token issuer for authenticated scenarios. - Use
TestEndpointAsyncwhen native and Lambda responses should be deterministic and equal. For timestamps, generated IDs or other variable output, callTestEndpointNativeAsyncandTestEndpointLambdaAsyncseparately and assert the relevant behavior in each.
The runnable greeting API test shows the fixture constructor and a request assertion.
See the sample tests, testing conventions and toolkit overview.
Releases
1.0.8
- docs: expand XML docblocks across all projects for the DocFX API reference
1.0.7
- References
Anarchy.Toolkit.Web1.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.
| Product | Versions 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. |
-
net10.0
- Amazon.Extensions.Configuration.SystemsManager (>= 7.1.1)
- Amazon.Lambda.APIGatewayEvents (>= 3.0.1)
- Amazon.Lambda.AspNetCoreServer (>= 10.3.2)
- Amazon.Lambda.Core (>= 3.4.0)
- Amazon.Lambda.TestUtilities (>= 4.3.0)
- Anarchy.Toolkit.Testing (>= 1.1.0)
- Anarchy.Toolkit.Web (>= 1.1.0)
- AwesomeAssertions (>= 9.6.0)
- AWSSDK.Core (>= 4.1.0.1)
- AWSSDK.KeyManagementService (>= 4.1.0)
- AWSSDK.SecretsManager (>= 4.1.1)
- Humanizer (>= 3.0.10)
- IdentityServer4.AccessTokenValidation (>= 3.0.1)
- Microsoft.AspNetCore.Authentication.JwtBearer (>= 10.0.15)
- Microsoft.AspNetCore.Mvc.NewtonsoftJson (>= 10.0.15)
- Microsoft.AspNetCore.Mvc.Testing (>= 10.0.15)
- Microsoft.Extensions.Hosting.Systemd (>= 10.0.15)
- Microsoft.Identity.Client (>= 4.92.0)
- Microsoft.IdentityModel.JsonWebTokens (>= 8.23.0)
- Microsoft.NET.Test.Sdk (>= 18.12.0)
- Microsoft.OpenApi (>= 2.13.0)
- Moq (>= 4.21.0)
- Newtonsoft.Json (>= 13.0.4)
- Serilog (>= 4.4.0)
- Serilog.Sinks.Console (>= 6.1.1)
- Spectre.Console (>= 0.57.2)
- Swashbuckle.AspNetCore (>= 10.3.1)
- System.IdentityModel.Tokens.Jwt (>= 8.23.0)
- xunit.v3.extensibility.core (>= 4.0.3)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Initial release.