TracingAssertions 0.1.2

Prefix Reserved
dotnet add package TracingAssertions --version 0.1.2
                    
NuGet\Install-Package TracingAssertions -Version 0.1.2
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="TracingAssertions" Version="0.1.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="TracingAssertions" Version="0.1.2" />
                    
Directory.Packages.props
<PackageReference Include="TracingAssertions" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add TracingAssertions --version 0.1.2
                    
#r "nuget: TracingAssertions, 0.1.2"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package TracingAssertions@0.1.2
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=TracingAssertions&version=0.1.2
                    
Install as a Cake Addin
#tool nuget:?package=TracingAssertions&version=0.1.2
                    
Install as a Cake Tool

TracingAssertions

NuGet License: MIT .NET

Scope: Test projects only. Not intended for production code.

Framework-agnostic core for the TracingAssertions package family. The TUnit-native fluent assertion entry points ship in the adapter package TracingAssertions.TUnit.

Most users want TracingAssertions.TUnit, not this package directly. Install this core directly only when authoring a non-TUnit adapter or when you only need the span-capture primitive.

What's in this package

  • SpanCapture: a disposable, per-test capture that starts a raw ActivityListener (sampling AllDataAndRecorded) over one or more ActivitySources matched by name and collects the stopped System.Diagnostics.Activity spans. ForSource(name) / ForSources(names) create one, Captured exposes the collected spans in completion order, and Dispose() detaches the listener. Use it with a using statement for per-test isolation.
  • Query helpers on the capture: FindByOperationName(name), FindByOperationNameAndTag(name, tagKey, tagValue) (tag compared by invariant ToString), and ChildrenOf(parent) (direct children in the same trace).

No OpenTelemetry SDK, no exporter pipeline, and no NuGet runtime dependency (System.Diagnostics.DiagnosticSource is in the shared framework). AOT-compatible, trimmable, no runtime reflection.

Install

dotnet add package TracingAssertions.TUnit

The core (TracingAssertions) comes transitively; install it directly only when authoring a non-TUnit adapter for the assertion family.

License

MIT throughout. No runtime dependencies beyond the BCL.

Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net10.0

    • No dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on TracingAssertions:

Package Downloads
TracingAssertions.TUnit

TUnit-native OpenTelemetry distributed-tracing (Activity / span) assertions for .NET tests: fluent Assert.That(activity) entry points for operation name, tag existence and value, status, and single-hop parent/child and same-trace relationships. Span capture is a raw ActivityListener over an ActivitySource. Builds on the TracingAssertions framework-agnostic core. AOT-compatible, trimmable, no runtime reflection in the assertion path, and no NuGet runtime dependency.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.1.2 39 6/6/2026
0.1.1 52 6/5/2026
0.1.0 81 6/4/2026
0.0.1 55 6/4/2026

View the rendered release notes: https://github.com/JohnVerheij/TracingAssertions.TUnit/releases/tag/v0.1.2

Metadata-only release. No API or behavior change.

### Fixed

- Corrected the NuGet package `<Description>`. It described a foundation release carrying only `HasOperationName` and said the full fluent surface "lands in 0.1.0"; the package has shipped the complete surface (operation name, tag existence and value, status, parent/child, same-trace) since 0.1.0. The description now matches the README.

### Added

- README: a short example showing `.Because(reason)` chained on a span assertion, plus a test covering it. `.Because` is inherited from TUnit's base assertion type and has always worked on the generated span assertions; the note makes that explicit.

### Changed

- The release workflow now publishes the matching `CHANGELOG.md` section as the GitHub release body (`body_path`), so release notes carry the full hand-written detail instead of GitHub's auto-generated commit summary.