Soenneker.Tests.Logging
4.0.155
Prefix Reserved
dotnet add package Soenneker.Tests.Logging --version 4.0.155
NuGet\Install-Package Soenneker.Tests.Logging -Version 4.0.155
<PackageReference Include="Soenneker.Tests.Logging" Version="4.0.155" />
<PackageVersion Include="Soenneker.Tests.Logging" Version="4.0.155" />
<PackageReference Include="Soenneker.Tests.Logging" />
paket add Soenneker.Tests.Logging --version 4.0.155
#r "nuget: Soenneker.Tests.Logging, 4.0.155"
#:package Soenneker.Tests.Logging@4.0.155
#addin nuget:?package=Soenneker.Tests.Logging&version=4.0.155
#tool nuget:?package=Soenneker.Tests.Logging&version=4.0.155
Soenneker.Tests.Logging
An infrastructure base class for test frameworks that want a lazily supplied ILogger and logged asynchronous delays.
Installation
dotnet add package Soenneker.Tests.Logging
Most applications should consume this indirectly through Soenneker.Tests.Unit, Soenneker.Tests.HostedUnit, or Soenneker.Tests.Integration, which configure the logger for their respective lifecycles.
Custom derivation
When deriving directly, initialize LazyLogger before Logger or a logged Delay is used:
using Microsoft.Extensions.Logging;
using Soenneker.Tests.Logging;
public abstract class LoggedTestBase : LoggingTest
{
protected LoggedTestBase(ILoggerFactory loggerFactory)
{
LazyLogger = new Lazy<ILogger<LoggingTest>>(
() => loggerFactory.CreateLogger<LoggingTest>());
}
}
The package does not create or own the logger factory. The derived test infrastructure controls logger lifetime and where output is written.
Logged delays
await Delay(
millisecondsDelay: 250,
reason: "waiting for the worker to observe the message",
cancellationToken: cancellationToken);
Delay logs at debug level immediately before calling Task.Delay. Set log: false to suppress that message. Cancellation and invalid delay values follow normal Task.Delay behavior.
Prefer waiting on an observable condition when one is available. A logged delay makes an unavoidable timing wait easier to diagnose, but it does not make time-dependent tests deterministic.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- AwesomeAssertions (>= 9.6.0)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.11)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on Soenneker.Tests.Logging:
| Package | Downloads |
|---|---|
|
Soenneker.Tests.Unit
A base test providing faker and autofaker capabilities |
|
|
Soenneker.Tests.Integration
A TUnit base class for integration tests that use a shared WebApplicationFactory host. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 4.0.155 | 21 | 8/30/2026 |
| 4.0.154 | 1,274 | 8/29/2026 |
| 4.0.153 | 41 | 8/29/2026 |
| 4.0.151 | 52,582 | 8/20/2026 |
| 4.0.150 | 30,392 | 8/11/2026 |
| 4.0.149 | 76,616 | 7/28/2026 |
| 4.0.148 | 42,542 | 7/19/2026 |
| 4.0.147 | 32,692 | 7/16/2026 |
| 4.0.146 | 22,162 | 7/14/2026 |
| 4.0.145 | 71,695 | 6/18/2026 |
| 4.0.144 | 63,396 | 6/9/2026 |
| 4.0.143 | 34,029 | 6/5/2026 |
| 4.0.142 | 75,206 | 5/12/2026 |
| 4.0.141 | 70,315 | 4/22/2026 |
| 4.0.140 | 128 | 4/22/2026 |
| 4.0.139 | 18,071 | 4/20/2026 |
| 4.0.138 | 20,535 | 4/14/2026 |
| 4.0.137 | 55,478 | 3/12/2026 |
| 4.0.132 | 29,834 | 3/10/2026 |
| 4.0.131 | 143 | 3/10/2026 |
Document test logging base configuration