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
instrumentNamestringThe non-empty instrument name to match exactly and case-sensitively.
expectedValueTThe exact typed value required. Numeric values of different runtime types do not compare equal.
meterNamestringThe 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
TThe numeric value type to compare without conversion.
HaveCount(int)
Requires exactly the supplied number of captured measurements.
public TestMetricCollectorAssertions HaveCount(int expected)
Parameters
expectedintThe 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
instrumentNamestringThe non-empty instrument name to match exactly and case-sensitively.
meterNamestringThe exact, case-sensitive meter name to match, or null to match any meter.
Returns
- TestMetricCollectorAssertions
This assertion object, for chaining, when no measurement matches.