Muonroi.RuleEngine.Testing
2.0.2
dotnet add package Muonroi.RuleEngine.Testing --version 2.0.2
NuGet\Install-Package Muonroi.RuleEngine.Testing -Version 2.0.2
<PackageReference Include="Muonroi.RuleEngine.Testing" Version="2.0.2" />
<PackageVersion Include="Muonroi.RuleEngine.Testing" Version="2.0.2" />
<PackageReference Include="Muonroi.RuleEngine.Testing" />
paket add Muonroi.RuleEngine.Testing --version 2.0.2
#r "nuget: Muonroi.RuleEngine.Testing, 2.0.2"
#:package Muonroi.RuleEngine.Testing@2.0.2
#addin nuget:?package=Muonroi.RuleEngine.Testing&version=2.0.2
#tool nuget:?package=Muonroi.RuleEngine.Testing&version=2.0.2
Muonroi.RuleEngine.Testing
Test scaffolding, mocks, and fluent assertions for verifying rule execution logic in the Muonroi ecosystem.
Installation
dotnet add package Muonroi.RuleEngine.Testing
Overview
Provides utilities for unit testing and verifying rule engines. It includes MRuleTestBuilder for scaffolding rule tests without spinning up a complete DI container. MRuleOrchestratorSpy allows you to mock the orchestrator to verify rule interactions, while MFactBagAssertions provides fluent assertion methods for inspecting state mutations.
Features
- Test Scaffolding:
MRuleTestBuildersimplifies rule environment setup for unit testing. - Orchestrator Spying:
MRuleOrchestratorSpyintercepts execution calls and capturesFactBagstate. - Fluent Assertions:
MFactBagAssertionsenables strict checks on variables and outcomes using BDD-style extensions (e.g.,ShouldHaveFact<T>()).
Quick Start
// Setup a rule test environment
var testContext = MRuleTestBuilder.Create<OrderContext>()
.WithRule(new HighValueOrderRule())
.Build();
// Execute the rule under test
var result = await testContext.ExecuteAsync(new OrderContext { Total = 1500 });
// Assert FactBag mutations fluently
result.FactBag.ShouldHaveFact<bool>("RequiresManagerApproval").Which.Should().BeTrue();
Ecosystem Combinations
+ RuleEngine.Core → Reliable Rule Logic
Pair with core engine implementation to ensure your custom IRule<TContext> instances and orchestrator pipelines perform deterministically.
+ Experience Engine → Autonomous Test Fixes
The Experience Engine's test_red_green heuristic uses test outcomes generated by this framework to automatically learn and fix logic flaws.
Samples
License
Apache 2.0 — see LICENSE-APACHE.
| Product | Versions 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 was computed. 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 was computed. 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. |
-
net8.0
- FluentAssertions (>= 7.2.0)
- Microsoft.Extensions.DependencyInjection (>= 10.0.3)
- Microsoft.Extensions.Logging (>= 10.0.3)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.3)
- Microsoft.NET.Test.Sdk (>= 17.12.0)
- Muonroi.RuleEngine.Abstractions (>= 2.0.2)
- Muonroi.RuleEngine.Core (>= 2.0.2)
- NSubstitute (>= 5.3.0)
- xunit (>= 2.9.2)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.