Stratara.Testing
4.4.8
Prefix Reserved
dotnet add package Stratara.Testing --version 4.4.8
NuGet\Install-Package Stratara.Testing -Version 4.4.8
<PackageReference Include="Stratara.Testing" Version="4.4.8" />
<PackageVersion Include="Stratara.Testing" Version="4.4.8" />
<PackageReference Include="Stratara.Testing" />
paket add Stratara.Testing --version 4.4.8
#r "nuget: Stratara.Testing, 4.4.8"
#:package Stratara.Testing@4.4.8
#addin nuget:?package=Stratara.Testing&version=4.4.8
#tool nuget:?package=Stratara.Testing&version=4.4.8
Stratara.Testing
Derived. The behaviour described here is specified under
openspec/specs/. Those specifications are the source; this page explains and illustrates them.
Test doubles and assertion helpers for applications built on the Stratara framework. Unit-test your event-sourced aggregates, encryption, messaging, and session-aware code without spinning up Postgres or RabbitMQ testcontainers.
Contents
AggregateTestHarness<T>/Aggregate.Rehydrate<T>(...)— given/when/then rehydration of an aggregate from events, using the sameApply(...)dispatch as production. Throws on an unmapped event so a forgotten overload fails the test (opt out withIgnoringUnmappedEvents()).InMemoryKeyStore— anIKeyStorethat mints random 256-bit DEKs per scope and supports rotation / revocation / scope-erasure, without a master KEK or key file.TestBlobEncryptor.CreateAesGcm()— the real AES-GCMISecureBlobEncryptorover anInMemoryKeyStore, so blob round-trips exercise production encryption.InMemoryMessageBus— anIMessageBuswith synchronous in-process dispatch and aPublishedlist for assertions.TestSessionContext/TestSessionContextProvider— preset Actor/SubjectSessionContextvalues and anISessionContextProviderdouble.InMemoryTenantMembershipStore— anITenantMembershipStoremirroring the EF store's contract semantics, including the membership-guarded active-tenant selection and the erasure sweeps.InMemorySettingStore— anISettingStorewith exact-scope reads/writes, so the scoped-settings fallback chain can be exercised without a database.InMemoryApiKeyStore— anIApiKeyStoremirroring the EF store's contract semantics: issuance, idempotent import of a caller-supplied key, fail-closed validation, revocation, erasure sweeps, and machine keys materialized into a membership store you can share and inspect.TestTenants.Of("acme")— stable, deterministic tenant/user ids derived from readable slugs.TestEvent.Create(payload, ...)— wrap an event payload inIEvent<T>with realistic metadata.ProjectionTester.HandleAsync(projection, event)— invoke a projection's (private)HandleAsynchandler directly, so you can unit-test it against mocked repositories.
Example
var account = AggregateTestHarness<Account>
.Given(new AccountOpened(id, "Ada", 100m))
.And(new AmountWithdrawn(id, 30m))
.Build();
Assert.Equal(70m, account.Balance);
Dependencies
Stratara.Abstractions,Stratara.Contracts,Stratara.Shared,Stratara.SecurityMicrosoft.Extensions.DependencyInjection
Reference it from your test projects only (<PackageReference Include="Stratara.Testing" />). It is
not meant for production code paths — the InMemoryKeyStore and DummyKeyStore provide no
durability or KEK custody.
| 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
- Microsoft.Extensions.DependencyInjection (>= 10.0.13)
- Stratara.Abstractions (>= 4.4.8)
- Stratara.Contracts (>= 4.4.8)
- Stratara.Security (>= 4.4.8)
- Stratara.Shared (>= 4.4.8)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Stratara.Testing:
| Package | Downloads |
|---|---|
|
Stratara.Testing.EntityFrameworkCore
Spin up the real Stratara event-sourcing write stack (EventSource, aggregation, snapshots, the EF Core write store) against a shared in-memory SQLite database in one call — production code paths, no Postgres, no Docker. Builds on Stratara.Testing's in-memory doubles. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 4.4.8 | 6 | 10/24/2026 |
| 4.4.7 | 58 | 10/23/2026 |
| 4.4.6 | 141 | 10/22/2026 |
| 4.4.5 | 384 | 10/14/2026 |
| 4.4.4 | 203 | 10/10/2026 |
| 4.4.3 | 111 | 10/10/2026 |
| 4.4.2 | 330 | 10/2/2026 |
| 4.4.1 | 188 | 9/29/2026 |
| 4.4.0 | 139 | 9/27/2026 |
| 4.3.1 | 213 | 9/25/2026 |
| 4.3.0 | 281 | 9/23/2026 |
| 4.2.0 | 183 | 9/18/2026 |
| 4.1.1 | 185 | 9/16/2026 |
| 4.1.0 | 119 | 9/16/2026 |
| 4.0.4 | 230 | 9/14/2026 |
| 4.0.3 | 203 | 9/3/2026 |
| 4.0.2 | 172 | 9/3/2026 |
| 4.0.1 | 131 | 9/2/2026 |
| 4.0.0 | 640 | 8/31/2026 |
| 4.0.0-preview.1 | 84 | 8/31/2026 |
A fix for hosts on the Orleans execution model. A store reader that catches up a large backlog and a singleton
work that runs long now answer their keep-alive, so neither leaves reminder errors in the silo's log. A silo that
joins while a singleton work runs long on another silo no longer fails its start. No API change, no schema change
and no migration.
### Fixed
- **A busy store reader or singleton work answers its keep-alive.** On the Orleans execution model, a projection or
saga reader that caught up a backlog for longer than the runtime's response timeout made its keep-alive tick wait
behind the catch-up, and Orleans logged `Could not deliver reminder tick` at Error, once per partition and
keep-alive period. A singleton work whose run outlasted the timeout did the same. Nothing was lost, but a large
catch-up left dozens of errors on the silo. The keep-alive and the poll now start a catch-up where none is
running and do not wait for it. A partition is still read by one catch-up at a time, and a commit during a
catch-up is still applied by it. A singleton work's keep-alive interleaves with its run, and runs still never
overlap.
- **A silo starts while a singleton work runs long.** A silo that started while a singleton work it registers ran
longer than the response timeout on another silo waited for that run in its own start. The start then failed
with a `TimeoutException`. The call a starting silo makes to each singleton work and store reader now
interleaves, so the start goes on.
- *Operate the Orleans execution model* says that a durable timer whose handler outlasts the response timeout
still makes Orleans log `Could not deliver reminder tick` for that tick, and that the line says nothing about
the timer. It also says that, outside a deploy, the line now points to an unreachable store reader or singleton
work rather than a busy one.