Files
2026-03-13 09:11:35 -05:00

25 lines
708 B
C#

using Microsoft.Extensions.Logging;
namespace OwnerNumberMigrationTest.TestDoubles;
public record Log(LogLevel LogLevel, Exception? Exception, string Message);
public class FakeLogger : ILogger
{
public IList<Log> Logs { get; }= new List<Log>();
public IDisposable BeginScope<TState>(TState state)
{
throw new NotImplementedException();
}
public bool IsEnabled(LogLevel logLevel)
{
throw new NotImplementedException();
}
public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter)
{
Logs.Add(new Log(logLevel, exception, formatter(state, exception)));
}
}