25 lines
708 B
C#
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)));
|
|
}
|
|
} |