Anarchy.Toolkit.Testing.Db 1.1.6

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

Anarchy.Toolkit.Testing.Db

Provider-agnostic relational database helpers for integration tests.

dotnet add package Anarchy.Toolkit.Testing.Db
  • Use DbTestHelper.RegisterEnumTypeHandler<TEnum>() to register enum type handlers.
  • Use TruncateTableAsync<TConnection, TDialect> or ClearTableAsync for table cleanup and DbOptionsMapper for options mapping.
  • Provider-specific fixtures are available in Testing.Postgres, Testing.Oracle and Testing.Mysql.

When to use it

Use this package in database integration tests or when building a new provider's test kit. It contains common cleanup and mapping helpers, not a database server, schema migration tool or provider-specific connection setup.

How to use it

Create a real test database and a provider-specific storage policy, then register any enum handlers before testing Dapper mappings. For cleanup, choose truncation through the dialect or a DELETE through ClearTableAsync:

using Anarchy.Toolkit.Testing.Db.Helper;

DbTestHelper.RegisterEnumTypeHandler<UserStatus>();
await DbTestHelper.ClearTableAsync<MyConnection>(policy, "users", cancellationToken);

Replace UserStatus, MyConnection and policy with your own enum, database connection type and configured policy. Table names are inserted into SQL, so use trusted fixed identifiers, never user input. Cleanup is destructive; use a dedicated test schema and account for foreign keys, identity behavior and tests running concurrently.

See the testing conventions and toolkit overview.

Releases

1.1.6

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

1.1.5

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

1.1.4

  • chore(deps): update AWS SDK packages

1.1.2

  • build: migrate local automation to build tooling

1.1.1

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

1.1.0

  • Updated the relational persistence dependency alongside configurable maximum pool size support.

1.0.1

  • Added a package-specific NuGet README.

1.0.0

  • Introduced provider-agnostic database test helpers and an options mapper.
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 (6)

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

Package Downloads
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.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.Mysql

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

Anarchy.Toolkit.Testing.Db.Mysql

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

Anarchy.Toolkit.Testing.Db.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.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.0.1 0 11/21/2026
2.0.0 0 11/20/2026
1.2.1 98 11/17/2026
1.2.0 75 11/17/2026
1.1.6 118 11/16/2026
1.1.5 136 11/14/2026
1.1.4 127 11/13/2026
1.1.3 113 11/9/2026
1.1.2 109 11/9/2026
1.1.0 119 11/6/2026
1.0.1 120 11/6/2026
1.0.0 127 11/5/2026

Initial release.