Anarchy.Toolkit.Testing 3.0.0

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

Anarchy.Toolkit.Testing

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

Shared test helpers, fixtures and assertions for toolkit-based applications.

dotnet add package Anarchy.Toolkit.Testing
  • Base tests and fixtures on TestCaseBase, TestCaseBase<TAppSettings> and EntityFixtureBase; use TestHelper for common setup.
  • Test instrumentation with TestTelemetry: an AppTelemetry whose logs (InMemoryLoggerProvider, with properties and scopes) and metrics (InMemoryMetricRecorder) are captured in memory. services.AddTestTelemetry(capture) routes a container's telemetry to the same capture.
  • Database, AWS and web-specific helpers (including API Gateway response assertions) live in separate Testing.* packages.

When to use it

Reference this package from test projects, not production services. It is useful for focused unit tests that need repeatable entities, a host environment or telemetry without sending logs and metrics to a real backend. Use the specialized test kits when the test needs a database, messaging service or web host.

How to use it

  1. Derive a test class from TestCaseBase and pass FixtureTelemetry.Telemetry to the subject under test. Assert business behavior first; inspect FixtureTelemetry.Logs or FixtureTelemetry.Metrics when telemetry itself is under test.
  2. Derive fixtures from EntityFixtureBase<T> and implement BuildDefaultFixture(). Call Build() for defaults or Build(new { Property = value }) to vary only the scenario-specific fields. Null overrides require overrideWithNulls: true.
  3. Use TestCaseBase<TAppSettings> or TestHelper.TestSettings<TAppSettings>() for typed settings. Embed appsettings.json and appsettings.Development.json in the assembly declaring the settings type, and keep real credentials out of test resources.

See the testing guide for a test and fixture example.

See the testing conventions and package catalog.

Third-party dependencies

This package brings these libraries, which its name does not announce:

Library Why In the public API?
xUnit.net v3 (xunit.v3.extensibility.core) The test framework the kits are written for; Xunit is a global using No: brought to test projects
Moq Mocks for the test projects No: brought to test projects
AwesomeAssertions Fluent assertions, extended by the kit's assertion extensions Yes: the assertion extensions build on it
Spectre.Console Console output for test projects No: brought to test projects
Newtonsoft.Json Parses response bodies (ResponseHelper) No

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 (10)

Showing the top 5 NuGet packages that depend on Anarchy.Toolkit.Testing:

Package Downloads
Anarchy.Toolkit.Testing.Web

Web end-to-end test base (RestApiTestCaseBase exercising both the native Kestrel and AWS Lambda pipelines), a testable Lambda entry point, and HTTP request helpers.

Anarchy.Toolkit.Testing.Postgres

PostgreSQL integration-test fixtures: connection string, connection pool, retry/resilience policy and Unit of Work fixtures, options mapping, enum type handlers, and table reset helpers.

Anarchy.Toolkit.Testing.Oracle

Oracle integration-test fixtures: connection string, connection pool, retry/resilience policy and Unit of Work fixtures, options mapping, enum type handlers, and table reset helpers.

Anarchy.Toolkit.Testing.Mysql

MySQL integration-test fixtures, settings mapping, enum handlers and table reset helpers.

Anarchy.Toolkit.Testing.Aws

AWS test helpers: SNS/SQS helpers (typically against LocalStack), SqsMessageFixture with gzip/zlib bodies, and LambdaContextFixture for Lambda handlers under test.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
3.0.0 75 11/27/2026
2.0.1 224 11/21/2026
2.0.0 152 11/20/2026
1.1.1 212 11/17/2026
1.1.0 182 11/17/2026
1.0.7 151 11/16/2026
1.0.6 189 11/14/2026
1.0.5 158 11/13/2026
1.0.4 136 11/9/2026
1.0.3 136 11/9/2026
1.0.1 180 11/6/2026
1.0.0 148 11/5/2026

## Releases

### 3.0.0

- **Breaking:** the API Gateway response assertions move to `Anarchy.Toolkit.Testing.Runtime.Web.Aws`, so this package references no AWS package.
- **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.

### 2.0.1

- 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
- refactor(telemetry)!: remove legacy APIs and simplify namespaces

### 1.1.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.1.0

- build(deps): upgrade Swashbuckle.AspNetCore to 11.0.1 and Microsoft.OpenApi to 3.11.1

### 1.0.7

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

### 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 shared test bases, fixtures, request and response helpers, and in-memory observability assertions.