using e_suite.API.Common.repository;
using e_suite.UnitTestCore;
using MockQueryable;

namespace e_suite.Modules.ExceptionLogManager.UnitTests.Repository;

public class FakeExceptionLogManagerRepository : FakeRepository, IExceptionLogRepository
{
    public List<Database.Core.Tables.Diagnostics.ExceptionLog> ExceptionLogs = [];

    public IQueryable<Database.Core.Tables.Diagnostics.ExceptionLog> GetExceptionLogs()
    {
        return ExceptionLogs.BuildMock();
    }

    public Task<long> LogException(Database.Core.Tables.Diagnostics.ExceptionLog exception, CancellationToken cancellationToken)
    {
        ExceptionLogs.Add(exception);
        return Task.FromResult(exception.Id);
    }
}
