OrionAudit.Testing 0.10.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package OrionAudit.Testing --version 0.10.0
                    
NuGet\Install-Package OrionAudit.Testing -Version 0.10.0
                    
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="OrionAudit.Testing" Version="0.10.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="OrionAudit.Testing" Version="0.10.0" />
                    
Directory.Packages.props
<PackageReference Include="OrionAudit.Testing" />
                    
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 OrionAudit.Testing --version 0.10.0
                    
#r "nuget: OrionAudit.Testing, 0.10.0"
                    
#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 OrionAudit.Testing@0.10.0
                    
#: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=OrionAudit.Testing&version=0.10.0
                    
Install as a Cake Addin
#tool nuget:?package=OrionAudit.Testing&version=0.10.0
                    
Install as a Cake Tool

OrionAudit.Testing

Testing helpers for OrionAudit. Provides AuditCapture, fluent assertions, and in-memory resolvers — framework-agnostic, with no dependency on xUnit, NUnit, or FluentAssertions. Throws plain exceptions on failure so it works with any test runner.

dotnet add package OrionAudit.Testing

Capture and assert

using Moongazing.OrionAudit;
using Moongazing.OrionAudit.Testing;

// Act — write something that produces an audit row.
ctx.Orders.Add(new Order { Status = "Pending" });
await ctx.SaveChangesAsync();

// Assert.
AuditCapture.From(ctx)
    .Should()
    .HaveLogged<Order>(AuditAction.Inserted)
    .HaveLoggedExactly(1).Of<Order>();

In-memory user / tenant resolvers

Replace the real resolvers in tests when you need deterministic attribution:

services.AddSingleton<IAuditUserResolver>(new InMemoryAuditUserResolver(
    new AuditUser("test-user", "Test User")));

services.AddSingleton<IAuditTenantResolver>(new InMemoryAuditTenantResolver("tenant-A"));

Both resolvers expose mutable User / TenantId properties so the same instance can be re-pointed mid-test to simulate cross-tenant scenarios.

Why no FluentAssertions / xUnit dependency

OrionAudit.Testing ships with applications that run their tests on any framework. Pulling in a specific assertion library would force a choice on consumers. Failures throw OrionAuditAssertionException — every modern test runner treats any thrown exception as a test failure, so this works everywhere.

See the project repository for the full design spec, sample app, and benchmarks.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  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

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.11.3 106 7/28/2026
0.11.1 112 6/30/2026
0.11.0 110 6/28/2026
0.10.0 118 6/27/2026
0.9.0 118 6/22/2026
0.8.1 119 6/20/2026
0.8.0 108 6/19/2026
0.7.32 123 6/17/2026
0.7.31 122 6/16/2026
0.7.30 137 6/16/2026
0.7.29 110 6/15/2026
0.7.28 114 6/15/2026
0.7.27 118 6/15/2026
0.7.26 122 6/13/2026
0.7.25 112 6/13/2026
0.7.24 114 6/12/2026
0.7.23 123 6/12/2026
0.7.22 112 6/11/2026
0.7.21 109 6/11/2026
0.7.20 106 6/11/2026
Loading failed