Stratara.Testing
4.4.6
Prefix Reserved
See the version list below for details.
dotnet add package Stratara.Testing --version 4.4.6
NuGet\Install-Package Stratara.Testing -Version 4.4.6
<PackageReference Include="Stratara.Testing" Version="4.4.6" />
<PackageVersion Include="Stratara.Testing" Version="4.4.6" />
<PackageReference Include="Stratara.Testing" />
paket add Stratara.Testing --version 4.4.6
#r "nuget: Stratara.Testing, 4.4.6"
#:package Stratara.Testing@4.4.6
#addin nuget:?package=Stratara.Testing&version=4.4.6
#tool nuget:?package=Stratara.Testing&version=4.4.6
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.11)
- Stratara.Abstractions (>= 4.4.6)
- Stratara.Contracts (>= 4.4.6)
- Stratara.Security (>= 4.4.6)
- Stratara.Shared (>= 4.4.6)
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.7 | 0 | 10/23/2026 |
| 4.4.6 | 83 | 10/22/2026 |
| 4.4.5 | 332 | 10/14/2026 |
| 4.4.4 | 202 | 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 |
| 3.4.0 | 308 | 8/28/2026 |
A host on the Orleans execution model can now wait until a projection has applied what it committed, instead of
reading its read model and hoping the projection is through. Additive; no schema change and no migration.
### Added
- **`IProjectionProgress`** (`Stratara.Abstractions`), registered by `AddStrataraProjectionGrains()`.
`MarkAsync()` returns a `StoreMark` that covers every entry committed at the time of the call, in every partition
— on PostgreSQL also an entry that committed while another write was still open. `WaitAsync(projection, mark,
timeout)`, with the projection named by its type or its framework name, answers with a `ProjectionWaitResult`:
`Reached` only once the projection has applied every entry the mark covers; otherwise, at the limit, `Stalled`,
`Suspended` or `TimedOut` with the partitions behind; `MarkNotApplicable` at once for a mark taken under another
reader or partition count. A rebuild or a full replay during a wait is waited through; an unknown projection is
refused. See *Read your own write* in the projection guide.
- **`ICommittedPositionReader.CommittedHeadAsync`**, the highest position the store shows as committed. The default
answers `HeadAsync`; the native PostgreSQL reader answers it without the horizon its head is held back to. A
reader of your own that holds its head back overrides it.
### Upgrade notes
- Adopt the wait once every silo runs this release: a silo of an earlier version does not answer it, and a wait
whose partition lives there fails with the grain call's error.