OmniAssert.Extensions
2.2.0
See the version list below for details.
dotnet add package OmniAssert.Extensions --version 2.2.0
NuGet\Install-Package OmniAssert.Extensions -Version 2.2.0
<PackageReference Include="OmniAssert.Extensions" Version="2.2.0" />
<PackageVersion Include="OmniAssert.Extensions" Version="2.2.0" />
<PackageReference Include="OmniAssert.Extensions" />
paket add OmniAssert.Extensions --version 2.2.0
#r "nuget: OmniAssert.Extensions, 2.2.0"
#:package OmniAssert.Extensions@2.2.0
#addin nuget:?package=OmniAssert.Extensions&version=2.2.0
#tool nuget:?package=OmniAssert.Extensions&version=2.2.0
<div align="center"> <img src="https://raw.githubusercontent.com/bolorundurowb/OmniAssert/refs/heads/master/assets/omni-assert-logo.svg" alt="omni assert logo" /> <h1 align="center">Omni Assert</h1> </div>
<p align="center"> <a href="https://github.com/bolorundurowb/OmniAssert/actions/workflows/build-and-test.yml"> <img src="https://github.com/bolorundurowb/OmniAssert/actions/workflows/build-and-test.yml/badge.svg" alt="Build, Test & Coverage" /> </a> <a href="https://codecov.io/gh/bolorundurowb/OmniAssert"> <img src="https://codecov.io/gh/bolorundurowb/OmniAssert/graph/badge.svg?token=J9ssbN9xYA" alt="codecov" /> </a> <a href="./LICENSE"> <img src="https://img.shields.io/badge/license-GPLv3-orange.svg" alt="License" /> </a> </p>
OmniAssert is a fluent assertion library for .NET 10 and C# 14. Tests read like plain English and failures show the expression under test, actual values, and optional compile-time operand capture.
Built with substantial AI assistance. Review the implementation before use in security-sensitive or compliance-heavy environments.
Documentation
Full documentation — API reference, soft assertions, object diffing, interceptors, analyzer rules (OA001–OA007), v1 → v2 migration, and Extensions.
Key features
- Fluent API —
user.Email.Must().Contain("@")reads naturally across strings, numbers, collections, objects, exceptions, files, dates, spans, and nullable values - Deep object comparison —
BeEquivalentTocompares object graphs recursively with hierarchical diffs - Soft assertions —
AssertionScopecollects multiple failures and reports them together - Compile-time diagnostics — optional Roslyn interceptors capture operand values when boolean expressions fail
Quick start
<ItemGroup>
<PackageReference Include="OmniAssert" Version="2.2.0" />
<PackageReference Include="OmniAssert.Extensions" Version="2.2.0" />
</ItemGroup>
using OmniAssert;
using OmniAssert.Extensions.Web; // when using Extensions
user.Id.Must().BeGreaterThan(0);
user.Email.Must().BeEmailAddress();
(() => Service.Create(badInput)).Throws<ArgumentException>();
Contributing
See CONTRIBUTING.md.
License
GNU General Public License v3.0 — see LICENSE.
| Product | Versions 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. |
-
net10.0
- OmniAssert (>= 2.2.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
v2.2.0
- Initial public release of OmniAssert.Extensions alongside OmniAssert 2.2.0.
- Web, financial, security, and regional assertion extensions with companion validators.
- Requires OmniAssert package at the same version.