79688246

Date: 2025-07-03 02:49:20
Score: 3.5
Natty:
Report link

how about using the FakeLogger?
https://learn.microsoft.com/en-nz/dotnet/api/microsoft.extensions.logging.testing.fakelogger
https://devblogs.microsoft.com/dotnet/fake-it-til-you-make-it-to-production/

using Microsoft.Extensions.Logging.Testing;

public class Tests
{
    private readonly FakeLogger<GetImageByPropertyCode> _fakeLogger = new();

    [Fact]
    public void Test()
    {
        _fakeLogger.Collector
            .GetSnapshot()
            .Count(l => l.Message.StartsWith("whatevs"))
            .Should().Be(1);
    }
Reasons:
  • Probably link only (1):
  • Has code block (-0.5):
  • Ends in question mark (2):
  • Starts with a question (0.5): how
  • Low reputation (0.5):
Posted by: more urgent jest