Mistruna.Core.Testing 5.0.0

dotnet add package Mistruna.Core.Testing --version 5.0.0
                    
NuGet\Install-Package Mistruna.Core.Testing -Version 5.0.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="Mistruna.Core.Testing" Version="5.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Mistruna.Core.Testing" Version="5.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Mistruna.Core.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 Mistruna.Core.Testing --version 5.0.0
                    
#r "nuget: Mistruna.Core.Testing, 5.0.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 Mistruna.Core.Testing@5.0.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=Mistruna.Core.Testing&version=5.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Mistruna.Core.Testing&version=5.0.0
                    
Install as a Cake Tool

Mistruna.Core

CI NuGet License: MIT

Production-oriented .NET building blocks for ASP.NET Core microservices: CQRS, validation, ProblemDetails, persistence, Redis, RabbitMQ, observability, resilience, and optional monetization primitives.

Packages

Package TFM Responsibility
Mistruna.Core.Abstractions net8.0;net10.0 Results, CQRS markers, entity/value-object bases, persistence contracts, domain events, and pagination DTOs
Mistruna.Core net10.0 MediatR registration, validation and logging behaviors, exceptions, and core DI
Mistruna.Core.AspNetCore net10.0 ProblemDetails, health, versioning, CORS, JWT, and IP rate limiting
Mistruna.Core.EfCore net10.0 EF repositories, unit of work, and conventions
Mistruna.Core.Caching.Redis net10.0 Redis caching and health check
Mistruna.Core.Messaging.RabbitMq net10.0 RabbitMQ.Client 7 asynchronous bus
Mistruna.Core.Monetization net10.0 API keys, plan authorization, tiered rate limits, idempotency, and metering
Mistruna.Core.Observability net10.0 OpenTelemetry registration and MediatR activity enrichment
Mistruna.Core.Resilience net10.0 HttpClient resilience presets and marked-command retry behavior
Mistruna.Core.Testing net10.0 EF async providers and consumer test helpers

There is no umbrella meta-package. Add only the packages your service uses:

dotnet add package Mistruna.Core
dotnet add package Mistruna.Core.AspNetCore
dotnet add package Mistruna.Core.EfCore

Quick start

using Mistruna.Core.DependencyInjection;
using Mistruna.Core.AspNetCore.DependencyInjection;
using Mistruna.Core.EfCore;

builder.Services.AddMistrunaCore(options =>
{
    options.RegisterAssemblies(typeof(Program).Assembly);
    options.AddValidation();
    options.AddLoggingBehavior();
});
builder.Services.AddMistrunaAspNetCore();
builder.Services.AddMistrunaEfCore<AppDbContext>();

var app = builder.Build();
app.UseMistrunaExceptionHandler();

Optional integrations compose independently:

builder.Services.AddMistrunaRedis(builder.Configuration);
builder.Services.AddMistrunaRabbitMq(builder.Configuration);
builder.Services.AddMistrunaObservability(builder.Configuration);
builder.Services.AddMistrunaResilience();
builder.Services.AddMistrunaMonetization();

app.UseMistrunaTieredRateLimiting();
app.UseMistrunaIdempotency();
app.UseMistrunaUsageMetering();

Define requests with the markers from Mistruna.Core.Abstractions:

public sealed record GetUserQuery(Guid Id) : IQuery<UserDto>;
public sealed record CreateUserCommand(string Email) : ICommand<Guid>;

Foundation features

  • System.Text.Json-only serialization and RFC 7807 ProblemDetails
  • MediatR command/query markers with opt-in validation and logging behaviors
  • EF Core repository, specification, and unit-of-work implementations
  • Redis caching and health checks
  • RabbitMQ.Client 7 async publishing via IMistrunaRabbitBus.PublishAsync
  • OpenTelemetry tracing, metrics, and MediatR activity enrichment
  • HttpClient resilience presets and optional marked-command retries
  • API key authentication, plan authorization, rate limits, idempotency, and metering
  • EF async query providers and result assertions for consumer tests

Samples

dotnet run --project samples/Mistruna.Core.Samples.BasicApi
dotnet run --project samples/Mistruna.Core.Samples.WorkerRabbit
dotnet run --project samples/Mistruna.Core.Samples.ApiWithOtel

The RabbitMQ sample requires a broker. See samples/README.md for configuration.

Build

Prerequisite: .NET 10 SDK

dotnet format --verify-no-changes
dotnet test
dotnet pack --configuration Release --output ./artifacts

./Build.ps1 runs restore, build, test, and pack. Packages are written to artifacts/.

Contributing

See CONTRIBUTING.md. Pull requests are welcome.

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

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
5.0.0 114 7/23/2026