Skip to content

Compono.Metrics.MeasurementVerificationBuilder T

Compono.Metrics

Compono.Metrics

MeasurementVerificationBuilder\<T> Class

A fluent filter chain over a resolved selection of captured measurements, ending in a thin, one-line forwarder to core CallVerifier - Once()/Never()/Exactly(int) each build a CallVerifier from the filtered match count right here and call the corresponding member. CallVerifier itself is never part of this type's public surface, and no new counting/Times abstraction is introduced. See docs/adr/0072-compono-metrics-testing-support-package.md §"Selection and matching".

public sealed class MeasurementVerificationBuilder<T>
    where T : struct

Type parameters

T

The measurement value type - one of the seven supported types.

Inheritance System.Object → MeasurementVerificationBuilder\<T>

Methods
AtLeast(int) Asserts the accumulated filters matched at least times times.
AtMost(int) Asserts the accumulated filters matched at most times times.
Exactly(int) Asserts the accumulated filters matched exactly times times.
Matching(Func<CapturedMeasurement<T>,bool>) Restricts matches to measurements satisfying an arbitrary predicate - the escape hatch for anything the named filters above don't cover (an exact tag-set match, a tolerance, and so on).
Never() Asserts the accumulated filters never matched.
Once() Asserts the accumulated filters matched exactly once.
WithoutTag(string) Restricts matches to measurements that have no tag with key key (ordinal).
WithTag(string, object) Restricts matches to measurements that contain a tag with key key (ordinal) whose value satisfies System.Object.Equals(System.Object,System.Object). Other tags are ignored, and there is no numeric coercion (200, an System.Int32, doesn't match 200L). Chain calls for several tags.
WithValue(T) Restricts matches to measurements whose value equals value exactly, using System.Collections.Generic.EqualityComparer<>.Default. Floating-point equality is exact - use Matching(Func<CapturedMeasurement<T>,bool>) for a tolerance.