dotnetassertions

Focused assertion extensions for TUnit.

Nine small packages. Each adds a fluent Assert.That(...) vocabulary for one domain. AOT-safe, reflection-free, MIT.

The family

LogAssertions.TUnit

Assert on logs captured from ILogger via a fake collector.

await Assert.That(logs).HasLogged(Warning);

SnapshotAssertions.TUnit

Text-snapshot and approval testing with scrubbers and diffs.

await Assert.That(output).MatchesSnapshot();

TimeAssertions.TUnit

TimeProvider state, timer leaks, and time budgets.

await Assert.That(provider).HasNoActiveTimers();

MathAssertions.TUnit

Tolerance-aware numeric, geometry, and statistics checks.

await Assert.That(v).IsApproximatelyEqualTo(pi);

JsonAssertions.TUnit

JSON path, value, and shape assertions over a document.

await Assert.That(json).HasJsonProperty("id");

SseAssertions.TUnit

Server-Sent Events wire-format and event-stream checks.

await Assert.That(stream).HasEvent("message");

GrpcAssertions.TUnit

gRPC status codes, metadata, and response assertions.

await Assert.That(call).HasStatusCode(OK);

TracingAssertions.TUnit

OpenTelemetry Activity, span, and tag assertions.

await Assert.That(activity).HasTag("http.method");

MetricsAssertions.TUnit

Metrics and instrument measurements via a collector.

await Assert.That(metrics).HasCounted("requests");