Rig.TUnit.Databases.NoSql.Dynamo
0.1.0-beta.2
dotnet add package Rig.TUnit.Databases.NoSql.Dynamo --version 0.1.0-beta.2
NuGet\Install-Package Rig.TUnit.Databases.NoSql.Dynamo -Version 0.1.0-beta.2
<PackageReference Include="Rig.TUnit.Databases.NoSql.Dynamo" Version="0.1.0-beta.2" />
<PackageVersion Include="Rig.TUnit.Databases.NoSql.Dynamo" Version="0.1.0-beta.2" />
<PackageReference Include="Rig.TUnit.Databases.NoSql.Dynamo" />
paket add Rig.TUnit.Databases.NoSql.Dynamo --version 0.1.0-beta.2
#r "nuget: Rig.TUnit.Databases.NoSql.Dynamo, 0.1.0-beta.2"
#:package Rig.TUnit.Databases.NoSql.Dynamo@0.1.0-beta.2
#addin nuget:?package=Rig.TUnit.Databases.NoSql.Dynamo&version=0.1.0-beta.2&prerelease
#tool nuget:?package=Rig.TUnit.Databases.NoSql.Dynamo&version=0.1.0-beta.2&prerelease
Rig.TUnit.Databases.NoSql.Dynamo
LocalStack-backed Amazon DynamoDB fixture with
GsiVerifierfor declarative Global-Secondary-Index assertions.
What this package is
The Rig.TUnit DynamoDB provider. DynamoFixture spins a LocalStack
container with the DynamoDB feature enabled and exposes an
AmazonDynamoDBClient pointing at it. Ships GsiVerifier — a declarative
GSI assertion helper that checks name, partition key, sort key, and
status against the live table schema, saving reams of boilerplate WAIT FOR GSI ACTIVE polling code.
When to use it
- Integration tests exercising DynamoDB-specific semantics (conditional writes, TransactionWrite, GSI projections).
- Asserting table+GSI definitions match the design spec.
- Not for: DAX (DynamoDB Accelerator) — LocalStack does not emulate.
Prerequisites
- .NET 10 SDK
- Docker Desktop / Colima (LocalStack image ~400 MB)
AWSSDK.DynamoDBv2(transitive)
Quick start
using Amazon.DynamoDBv2.Model;
using Rig.TUnit.Databases.NoSql.Dynamo.Fixtures;
using Rig.TUnit.Databases.NoSql.Dynamo.Helpers;
await using var fx = new DynamoFixture();
await fx.InitializeAsync();
await fx.Client.CreateTableAsync(new CreateTableRequest
{
TableName = "orders",
KeySchema = [new("Pk", Amazon.DynamoDBv2.KeyType.HASH)],
AttributeDefinitions = [new("Pk", Amazon.DynamoDBv2.ScalarAttributeType.S)],
BillingMode = Amazon.DynamoDBv2.BillingMode.PAY_PER_REQUEST,
});
Options
| Property | Type | Default | Description |
|---|---|---|---|
Image |
string |
"localstack/localstack:3" |
LocalStack image |
StartupTimeoutSeconds |
int |
120 |
LocalStack boot |
AccessKeyId |
string |
"test" |
LocalStack default |
SecretAccessKey |
string |
"test" |
LocalStack default |
Region |
string |
"us-east-1" |
Region label |
Fixture + helper APIs
Rig.TUnit.Databases.NoSql.Dynamo.Fixtures.DynamoFixtureRig.TUnit.Databases.NoSql.Dynamo.Options.DynamoFixtureOptionsRig.TUnit.Databases.NoSql.Dynamo.Builder.DynamoRigBuilderRig.TUnit.Databases.NoSql.Dynamo.Helpers.GsiVerifierRig.TUnit.Databases.NoSql.Dynamo.Helpers.GsiExpectation
Per-test isolation
Per-test table naming via IsolationKey: orders_{IsolationKey:short}.
Table create is ~100 ms (LocalStack's DynamoDB emulation is CPU-fast).
Teardown deletes the table.
Parallelism + performance
- First-run pull: ~30 s.
- Warm startup: ~10 s.
- Per-test table create + delete: ~150 ms.
- Parallelism: 8+ typical — LocalStack handles concurrent DDL well.
Troubleshooting
ResourceNotFoundExceptionafterCreateTableAsync— LocalStack creates the table asynchronously;WaitForTableActiveorGsiVerifier.VerifyAsyncpolls untilTableStatus=ACTIVE. Do not assume immediate readiness.- Eventually consistent reads surprise tests — LocalStack defaults to
strong consistency, but DynamoDB proper does not. Set
ConsistentRead=trueon your test queries to match the production guarantee.
See docs/troubleshooting.md#dynamodb.
Provider quirks + edge cases
- LocalStack's DynamoDB emulation is close to production but diverges on: rate limiting (never throttles), per-table encryption metadata, and auto-scaling. Tests asserting these must run against real AWS.
- GSIs can project
ALL,KEYS_ONLY, orINCLUDE;GsiExpectationcurrently validates name + keys, not projection shape (open issue).
Benchmarks
See DynamoBenchmarks.cs;
baseline in benchmarks/baseline-005.json.
Related docs
License
MIT. See LICENSE.
| 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
- AWSSDK.DynamoDBv2 (>= 3.7.403)
- Bogus (>= 35.6.1)
- Microsoft.Extensions.Configuration (>= 10.0.0)
- Microsoft.Extensions.Configuration.Binder (>= 10.0.0)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.0)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.0)
- Microsoft.Extensions.Options (>= 10.0.0)
- Microsoft.Extensions.Options.DataAnnotations (>= 10.0.0)
- Rig.TUnit.Databases.NoSql (>= 0.1.0-beta.2)
- Testcontainers (>= 4.11.0)
- Testcontainers.LocalStack (>= 4.11.0)
- TUnit.Core (>= 1.34.5)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Rig.TUnit.Databases.NoSql.Dynamo:
| Package | Downloads |
|---|---|
|
Rig.TUnit.All
Meta-package containing every Rig.TUnit.* package. DISCOURAGED — prefer per-feature or per-stack meta-packages (Rig.TUnit, Rig.TUnit.Microservices). |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.1.0-beta.2 | 43 | 4/27/2026 |
| 0.0.0-alpha.0.14 | 46 | 4/26/2026 |