Axiom Assertions for .NET¶
Axiom Assertions is a deterministic fluent assertion library for .NET tests. It focuses on stable failure output, explicit grouped assertions with Batch, configurable equivalency, and a package layout that stays clear about what is core and what is optional.
Axiom is still early in adoption, so these docs focus on what is implemented today and the test scenarios it currently covers well.
What Axiom Focuses On¶
- deterministic failure messages that stay stable in CI and code review
- explicit multi-assertion aggregation with
Batch - built-in equivalency support with configurable defaults
- analyzers and code fixes shipped with the normal
Axiom.Assertionsinstall path - optional JSON assertions without bloating the main package
- optional HTTP and API-response assertions without pushing that surface into every test project
- optional vector and retrieval assertions without forcing AI-specific APIs into the base package
Install¶
Most test projects should start with Axiom.Assertions:
dotnet add package Axiom.Assertions
Optional add-ons:
dotnet add package Axiom.Json
dotnet add package Axiom.Http
dotnet add package Axiom.Vectors
Advanced or special-case installs:
dotnet add package Axiom.Core
dotnet add package Axiom.Analyzers
Package Lineup¶
Axiom.Assertions¶
The default package for most test projects.
- fluent
Should()assertions - built-in equivalency, async, collection, string, and exception assertions
- bundled Axiom analyzers and code fixes
Axiom.Core¶
Install this directly when you want low-level primitives such as Batch, formatting, or configuration without the full fluent assertion surface.
Axiom.Analyzers¶
Install this separately when you want the diagnostics without the runtime assertion library.
Axiom.Json¶
Install this when you want structural JSON equivalency and simple JSON path assertions on top of the main Axiom assertion library.
Axiom.Http¶
Install this when you want HttpResponseMessage assertions for exact status codes, headers, content types, JSON bodies, and ProblemDetails-style API responses.
Axiom.Vectors¶
Install this when you want vector, embedding, and retrieval-focused assertions for AI and ranking tests in .NET.
Where To Start¶
- New to the library? Start with Getting Started
- Need current package, framework, or prerequisite support details? Read the Compatibility Matrix
- Need a minimal test-project example? Use the repository starter projects for xUnit, NUnit, or MSTest
- For the API catalog: go to Assertion Reference
- Migrating a test suite: read Migrating to Axiom or the focused Migrate from xUnit Assert to Axiom guide
- Evaluating trade-offs: read Axiom vs FluentAssertions, Axiom vs Shouldly, or the broader .NET assertion library page
- Working with structural comparison: go to Equivalency
- Working with JSON payloads or documents: go to JSON
- Testing HTTP or API responses: go to HTTP and API assertions
- Testing embeddings or ranked retrieval: go to Vectors or the focused Vector assertions for AI and retrieval tests in .NET
- Using diagnostics only: go to Analyzers
A Quick Example¶
using Axiom.Assertions;
using Axiom.Core;
user.Name.Should().NotBeNull();
user.Email.Should().Contain("@");
using var batch = Assert.Batch("profile");
user.Name.Should().StartWith("A");
user.Roles.Should().Contain("admin");