Class TestLogCollectorAssertions

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

Fluently verifies structured logs captured from a test host.

public sealed class TestLogCollectorAssertions
Inheritance
TestLogCollectorAssertions
Inherited Members

Methods

ContainMessage(string, LogLevel?, string?)

Requires a captured log whose message contains the supplied text.

public TestLogCollectorAssertions ContainMessage(string expectedText, LogLevel? level = null, string? category = null)

Parameters

expectedText string

The non-empty text that the formatted message must contain using ordinal matching.

level LogLevel?

The exact log level to require, or null to accept any level.

category string

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

Returns

TestLogCollectorAssertions

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

HaveCount(int)

Requires exactly the supplied number of captured log entries.

public TestLogCollectorAssertions HaveCount(int expected)

Parameters

expected int

The non-negative log-entry count required at assertion time.

Returns

TestLogCollectorAssertions

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

NotContainMessage(string, LogLevel?, string?)

Requires no captured log whose message contains the supplied text.

public TestLogCollectorAssertions NotContainMessage(string unexpectedText, LogLevel? level = null, string? category = null)

Parameters

unexpectedText string

The non-empty text matched ordinally against formatted messages.

level LogLevel?

The exact log level to match, or null to match any level.

category string

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

Returns

TestLogCollectorAssertions

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