MathAssertions 0.0.1
Prefix ReservedSee the version list below for details.
dotnet add package MathAssertions --version 0.0.1
NuGet\Install-Package MathAssertions -Version 0.0.1
<PackageReference Include="MathAssertions" Version="0.0.1" />
<PackageVersion Include="MathAssertions" Version="0.0.1" />
<PackageReference Include="MathAssertions" />
paket add MathAssertions --version 0.0.1
#r "nuget: MathAssertions, 0.0.1"
#:package MathAssertions@0.0.1
#addin nuget:?package=MathAssertions&version=0.0.1
#tool nuget:?package=MathAssertions&version=0.0.1
MathAssertions
Scope: Test projects only. Not intended for production code.
Framework-agnostic core for the MathAssertions package family. The actual TUnit fluent assertions ship in the framework-specific adapter package (currently MathAssertions.TUnit).
Most users want
MathAssertions.TUnit, not this package directly. This package only ships the sharedMathTolerancehelpers; the adapter package adds the assertion entry points your test framework expects.
What's in this package (v0.0.1)
MathTolerance static class with pure, NaN-aware, infinity-aware tolerance-comparison helpers:
IsApproximatelyEqual(double, double, double)IsApproximatelyEqual(float, float, float)IsApproximatelyEqual(Vector3, Vector3, double)(component-wise; components widen todoubleso a tightdoubletolerance is honored at full precision)
All helpers reject NaN and negative tolerance via ArgumentOutOfRangeException.
What lands at v0.1.0
Vector2 / Vector4 component-wise; Quaternion component-wise plus rotational equivalence (handling the q / -q double-cover); Matrix4x4 element-wise; Plane component-wise plus geometric equivalence; Complex; span overloads; statistics (mean, median, variance, percentile); linear-algebra invariants; number theory; 3D geometry primitives plus intersection / containment / pointcloud assertions.
Test-framework adapters
| Package | Test framework | Status |
|---|---|---|
MathAssertions.TUnit |
TUnit | Available now |
MathAssertions.NUnit |
NUnit | Possible if there is demand |
MathAssertions.xUnit |
xUnit | Possible if there is demand |
MathAssertions.MSTest |
MSTest | Possible if there is demand |
If you'd find a non-TUnit adapter useful, open a feature request. Adapters are not built proactively.
When to install this package directly
Only when authoring a non-TUnit adapter for the assertion family, or when calling MathTolerance from a [GenerateAssertion] extension on a private type. For any TUnit testing use case, install MathAssertions.TUnit.
Installation
dotnet add package MathAssertions.TUnit
MathAssertions comes transitively. You don't need to install it directly unless you're building your own adapter package.
Stability
The public surface above is semver-bound. Breaking changes require a major version bump. The exact text of any future failure-message rendering produced inside MathTolerance is not stable and may gain extra detail or change formatting in any release.
Repository
github.com/JohnVerheij/MathAssertions.TUnit for the full README, design notes, and roadmap.
License
MIT. Copyright (c) 2026 John Verheij.
| 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
- No dependencies.
NuGet packages (1)
Showing the top 1 NuGet packages that depend on MathAssertions:
| Package | Downloads |
|---|---|
|
MathAssertions.TUnit
TUnit-native math assertions for .NET tests. Fluent .Method(...) entry points (generated via TUnit's [GenerateAssertion]) covering tolerance comparisons (scalar, vector, quaternion, matrix, plane, complex, double[]/float[]), sequences, statistics, Vector3 linear algebra, long-integer number theory, and the Geometry3D primitive surface (containment, distance, intersection, pointcloud aggregates). Extensible: consumers add tolerance assertions for their own domain types via [GenerateAssertion] extensions calling MathTolerance helpers. AOT-compatible, trimmable, no reflection. |
GitHub repositories
This package is not used by any popular GitHub repositories.
See CHANGELOG.md