Class TestMetricCollectorAssertions

Namespace
XBullet.EasyTesting.Observability
Assembly
XBullet.EasyTesting.Observability.dll

Fluently verifies metric measurements captured from a test process.

public sealed class TestMetricCollectorAssertions
Inheritance
TestMetricCollectorAssertions
Inherited Members

Methods

ContainMeasurement<T>(string, T, string?)

Requires a measurement with the supplied instrument name and value.

public TestMetricCollectorAssertions ContainMeasurement<T>(string instrumentName, T expectedValue, string? meterName = null) where T : struct

Parameters

instrumentName string

The non-empty instrument name to match exactly and case-sensitively.

expectedValue T

The exact typed value required. Numeric values of different runtime types do not compare equal.

meterName string

The exact, case-sensitive meter name to require, or null to accept any meter.

Returns

TestMetricCollectorAssertions

This assertion object, for chaining, when at least one measurement matches.

Type Parameters

T

The numeric value type to compare without conversion.

HaveCount(int)

Requires exactly the supplied number of captured measurements.

public TestMetricCollectorAssertions HaveCount(int expected)

Parameters

expected int

The non-negative measurement count required at assertion time.

Returns

TestMetricCollectorAssertions

This assertion object, for chaining, when the exact count matches.

NotContainMeasurement(string, string?)

Requires no measurement with the supplied instrument name.

public TestMetricCollectorAssertions NotContainMeasurement(string instrumentName, string? meterName = null)

Parameters

instrumentName string

The non-empty instrument name to match exactly and case-sensitively.

meterName string

The exact, case-sensitive meter name to match, or null to match any meter.

Returns

TestMetricCollectorAssertions

This assertion object, for chaining, when no measurement matches.