Rig.TUnit.Databases.NoSql.Dynamo 0.1.0-beta.2

This is a prerelease version of Rig.TUnit.Databases.NoSql.Dynamo.
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
                    
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="Rig.TUnit.Databases.NoSql.Dynamo" Version="0.1.0-beta.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Rig.TUnit.Databases.NoSql.Dynamo" Version="0.1.0-beta.2" />
                    
Directory.Packages.props
<PackageReference Include="Rig.TUnit.Databases.NoSql.Dynamo" />
                    
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 Rig.TUnit.Databases.NoSql.Dynamo --version 0.1.0-beta.2
                    
#r "nuget: Rig.TUnit.Databases.NoSql.Dynamo, 0.1.0-beta.2"
                    
#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 Rig.TUnit.Databases.NoSql.Dynamo@0.1.0-beta.2
                    
#: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=Rig.TUnit.Databases.NoSql.Dynamo&version=0.1.0-beta.2&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Rig.TUnit.Databases.NoSql.Dynamo&version=0.1.0-beta.2&prerelease
                    
Install as a Cake Tool

Rig.TUnit.Databases.NoSql.Dynamo

LocalStack-backed Amazon DynamoDB fixture with GsiVerifier for 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.DynamoFixture
  • Rig.TUnit.Databases.NoSql.Dynamo.Options.DynamoFixtureOptions
  • Rig.TUnit.Databases.NoSql.Dynamo.Builder.DynamoRigBuilder
  • Rig.TUnit.Databases.NoSql.Dynamo.Helpers.GsiVerifier
  • Rig.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

  • ResourceNotFoundException after CreateTableAsync — LocalStack creates the table asynchronously; WaitForTableActive or GsiVerifier.VerifyAsync polls until TableStatus=ACTIVE. Do not assume immediate readiness.
  • Eventually consistent reads surprise tests — LocalStack defaults to strong consistency, but DynamoDB proper does not. Set ConsistentRead=true on 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, or INCLUDE; GsiExpectation currently validates name + keys, not projection shape (open issue).

Benchmarks

See DynamoBenchmarks.cs; baseline in benchmarks/baseline-005.json.

License

MIT. See LICENSE.

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