[0.2.0] - 2026-06-14: kind, root, event, and count assertions; sampling control
Minor release. Adds span and capture assertions for ASP.NET Core span testing, plus a sampling-control capture overload. Purely additive.
Added
- Span assertions:
Assert.That(span).HasKind(ActivityKind)(for exampleServerfor an inbound request span),IsRoot()(no parent),HasEvent(name), andHasExceptionEvent()(the OpenTelemetry"exception"event). The event assertions list the span's event names on failure. - Capture assertions:
Assert.That(capture).HasNoSpan(operationName)(the inverse ofHasSpan, for asserting an operation was never traced) andHasSpanCount(int). SpanCapture.ForSource(name, ActivitySamplingResult)andForSources(ActivitySamplingResult, params string[])capture under a chosen sampling result. The existing parameterless forms still forceAllDataAndRecorded. A lower result (for examplePropagationData) lets a test exercise code that branches onActivity.IsAllDataRequested, with the documented caveat that an activity's effective sampling is the maximum across all active listeners, so this takes effect only when the capture is the sole listener.
Changed
- Bumped
PackageValidationBaselineVersionfrom0.1.0to0.1.2on both packages so ApiCompat strict-mode validates0.2.0against the most recently published baseline.