Anarchy.Toolkit.Testing.Db
1.1.2
See the version list below for details.
dotnet add package Anarchy.Toolkit.Testing.Db --version 1.1.2
NuGet\Install-Package Anarchy.Toolkit.Testing.Db -Version 1.1.2
<PackageReference Include="Anarchy.Toolkit.Testing.Db" Version="1.1.2" />
<PackageVersion Include="Anarchy.Toolkit.Testing.Db" Version="1.1.2" />
<PackageReference Include="Anarchy.Toolkit.Testing.Db" />
paket add Anarchy.Toolkit.Testing.Db --version 1.1.2
#r "nuget: Anarchy.Toolkit.Testing.Db, 1.1.2"
#:package Anarchy.Toolkit.Testing.Db@1.1.2
#addin nuget:?package=Anarchy.Toolkit.Testing.Db&version=1.1.2
#tool nuget:?package=Anarchy.Toolkit.Testing.Db&version=1.1.2
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>orClearTableAsyncfor table cleanup andDbOptionsMapperfor 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<OrderStatus>();
await DbTestHelper.ClearTableAsync<MyConnection>(policy, "orders", cancellationToken);
Replace OrderStatus, 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.2
- build: migrate local automation to NUKE
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 | 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)
- Anarchy.Toolkit.Configuration (>= 1.0.3)
- Anarchy.Toolkit.Infrastructure.Persistence.Db (>= 1.1.2)
- AWSSDK.Core (>= 4.0.102.19)
- AWSSDK.Extensions.NETCore.Setup (>= 4.0.102.10)
- AWSSDK.KeyManagementService (>= 4.0.101.4)
- AWSSDK.SecretsManager (>= 4.0.100.25)
- Dapper (= 2.1.79)
- Humanizer (>= 3.0.10)
- Microsoft.Extensions.Caching.Memory (>= 10.0.14)
- Microsoft.Extensions.Configuration.Abstractions (>= 10.0.14)
- Microsoft.Extensions.Configuration.Json (>= 10.0.14)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.14)
- Microsoft.Extensions.Hosting (>= 10.0.14)
- Microsoft.Extensions.Hosting.Abstractions (>= 10.0.14)
- Microsoft.Extensions.Options.DataAnnotations (>= 10.0.14)
- Microsoft.Identity.Client (>= 4.92.0)
- Newtonsoft.Json (>= 13.0.4)
- Polly.Core (>= 8.9.1)
- Serilog (>= 4.4.0)
- Serilog.Sinks.Console (>= 6.1.1)
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.
Initial release.