Table of Contents

Namespace LogAssertions.TUnit

Classes

AssertAllExtensions

Batch-assertion entry point that runs multiple independent assertions against the same Microsoft.Extensions.Logging.Testing.FakeLogCollector in a single pass and reports all failures together, rather than failing fast on the first one. Conceptually similar to TUnit's own Assert.Multiple, scoped specifically to log assertions.

FakeLogCollectorTUnitInspectionExtensions

TUnit-specific non-asserting inspection helpers on Microsoft.Extensions.Logging.Testing.FakeLogCollector. The framework-agnostic counterparts live in FakeLogCollectorInspectionExtensions in the LogAssertions core package; helpers here add bindings to TUnit's per-test output writer so the rendered records appear inline in the test report.

HasLoggedAssertion

TUnit assertion that verifies a Microsoft.Extensions.Logging.Testing.FakeLogCollector contains matching log records. Inherits filter chaining from LogAssertionBase<TSelf>; adds count-expectation terminators (Once, Exactly, AtLeast, AtMost, Never) and the value-returning terminators GetMatch and GetMatches for handing the matched records to follow-up assertions.

HasLoggedSequenceAssertion

TUnit assertion that verifies a Microsoft.Extensions.Logging.Testing.FakeLogCollector contains a sequence of matching log records, in order. Each step is built from the same filter chain as HasLoggedAssertion (AtLevel, Containing, etc.); call Then() to commit the current step and start the next strictly-ordered step, or ThenAnyOrder(params Action<HasLoggedSequenceAssertion>[]) to commit a concurrent group whose sub-steps must all occur but in any order.

HasNotLoggedAssertion

TUnit assertion that verifies a Microsoft.Extensions.Logging.Testing.FakeLogCollector does not contain matching log records. Inherits filter chaining from LogAssertionBase<TSelf>; the expectation is fixed at zero matches (no terminators).

LogAssertionBase<TSelf>

Shared base class for HasLoggedAssertion, HasNotLoggedAssertion, and HasLoggedSequenceAssertion. Implements the filter chain (level, message, exception, structured-state, scope, event, and arbitrary-predicate filters) and the failure-message snapshot rendering. Derived classes own count-expectation semantics and the [AssertionExtension] attribute that registers the entry-point name.