Skip to content

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.Assertions install 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

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");