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
expectedTextstringThe non-empty text that the formatted message must contain using ordinal matching.
levelLogLevel?The exact log level to require, or null to accept any level.
categorystringThe 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
expectedintThe 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
unexpectedTextstringThe non-empty text matched ordinally against formatted messages.
levelLogLevel?The exact log level to match, or null to match any level.
categorystringThe exact, case-sensitive category to match, or null to match any category.
Returns
- TestLogCollectorAssertions
This assertion object, for chaining, when no entry matches.