![]() |
VOOZH | about |
dotnet add package Rig.TUnit.Databases.NoSql.Mongo --version 0.1.0-beta.2
NuGet\Install-Package Rig.TUnit.Databases.NoSql.Mongo -Version 0.1.0-beta.2
<PackageReference Include="Rig.TUnit.Databases.NoSql.Mongo" Version="0.1.0-beta.2" />
<PackageVersion Include="Rig.TUnit.Databases.NoSql.Mongo" Version="0.1.0-beta.2" />Directory.Packages.props
<PackageReference Include="Rig.TUnit.Databases.NoSql.Mongo" />Project file
paket add Rig.TUnit.Databases.NoSql.Mongo --version 0.1.0-beta.2
#r "nuget: Rig.TUnit.Databases.NoSql.Mongo, 0.1.0-beta.2"
#:package Rig.TUnit.Databases.NoSql.Mongo@0.1.0-beta.2
#addin nuget:?package=Rig.TUnit.Databases.NoSql.Mongo&version=0.1.0-beta.2&prereleaseInstall as a Cake Addin
#tool nuget:?package=Rig.TUnit.Databases.NoSql.Mongo&version=0.1.0-beta.2&prereleaseInstall as a Cake Tool
Testcontainers-backed MongoDB fixture with
CollectionPerTestHelperandBsonDiff.
The Rig.TUnit MongoDB provider. MongoFixture spins MongoDB via
Testcontainers and exposes an IMongoClient + default-database. Two
helpers solve the common pain points: CollectionPerTestHelper owns a
per-test collection scoped by IsolationKey and drops it on disposal,
and BsonDiff performs a structural diff between expected / actual
documents with the usual system-field scrub list.
$lookup, text indexes, transactions with replica set)._id / ts drift.Mongo2Go is
faster but produces different wire errors from the real server.MongoDB.Driver 3.x (transitive)using MongoDB.Bson;
using Rig.TUnit.Core.Helpers;
using Rig.TUnit.Databases.NoSql.Mongo.Fixtures;
using Rig.TUnit.Databases.NoSql.Mongo.Helpers;
await using var fx = new MongoFixture();
await fx.InitializeAsync();
await using var scope = new CollectionPerTestHelper(
fx.Database, IsolationKey.FromExecutionContext());
var orders = scope.GetCollection<BsonDocument>();
| Property | Type | Default | Description |
|---|---|---|---|
Image |
string |
"mongo:7" |
Image |
StartupTimeoutSeconds |
int |
60 |
Mongo boots fast |
ReplicaSetName |
string? |
null |
Set for transactions; off by default |
AuthDatabase |
string? |
null |
Off by default in dev mode |
Rig.TUnit.Databases.NoSql.Mongo.Fixtures.MongoFixtureRig.TUnit.Databases.NoSql.Mongo.Options.MongoFixtureOptionsRig.TUnit.Databases.NoSql.Mongo.Builder.MongoRigBuilderRig.TUnit.Databases.NoSql.Mongo.Helpers.CollectionPerTestHelperRig.TUnit.Databases.NoSql.Mongo.Assertions.BsonDiffCollectionPerTestHelper names collections {logical}_{IsolationKey:short}
and calls Database.DropCollectionAsync on DisposeAsync. Fully
parallel-safe.
Standalone servers do not support — set
ReplicaSetName = "rs0"; the fixture wires the replicaset init script.BsonDiff reports diff on _id — default scrub list includes
_id, _etag, _ts. If your domain exposes a domain-level Id
alongside _id, scrub it too.See .
w: 1 (acknowledged by primary) —
tests asserting durability across a restart must use w: "majority".MongoClient which is thread-safe; do not wrap in
using — dispose is process-level.See ;
baseline in benchmarks/baseline-005.json.
MIT. See .
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 net10.0 is compatible. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
Showing the top 1 NuGet packages that depend on Rig.TUnit.Databases.NoSql.Mongo:
| 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). |
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.1.0-beta.2 | 68 | 4/27/2026 |
| 0.0.0-alpha.0.14 | 76 | 4/26/2026 |