using e_suite.API.Common;
using e_suite.API.Common.repository;
using e_suite.Database.Audit;
using e_suite.Database.Audit.AuditEngine;
using e_suite.Database.Core.Tables.CustomFields;
using e_suite.UnitTestCore;
using eSuite.Core.Miscellaneous;
using Moq;

namespace e_suite.Modules.FormsManagerUnitTests;

public class FormsManagerUnitTestBase : TestBase
{
    protected FakeFormsRepository _fakeformRepository = null!;
    protected FakeCustomFieldRepository customFieldRepository = null!;
    protected Mock<ICustomFieldValidator> customFieldValidatorMock = null!;
    protected FakeCustomFieldHelper customFieldHelper = null!;
    protected AuditUserDetails auditResult = new();
    protected FormsManager.FormsManager _formManager = null!;
    
    public override async Task Setup()
    {
        await base.Setup();
        _fakeformRepository = new FakeFormsRepository();
        customFieldHelper = new FakeCustomFieldHelper();

        customFieldValidatorMock = new Mock<ICustomFieldValidator>();

        _formManager = new FormsManager.FormsManager(_fakeformRepository, customFieldRepository, customFieldHelper, customFieldValidatorMock.Object);
    }
}

public class FakeCustomFieldRepository : ICustomFieldRepository
{
    public Task<T> TransactionAsync<T>(Func<Task<T>> func)
    {
        throw new NotImplementedException();
    }

    public Task TransactionAsync(Func<Task> action)
    {
        throw new NotImplementedException();
    }

    public Task<CustomField?> GetByIdAsync(IGeneralIdRef id, CancellationToken cancellationToken)
    {
        throw new NotImplementedException();
    }

    public Task<CustomField?> GetByNameAsync(string name, CancellationToken cancellationToken)
    {
        throw new NotImplementedException();
    }

    public Task EditAsync(AuditUserDetails auditUserDetails, CustomField customField, CancellationToken cancellationToken)
    {
        throw new NotImplementedException();
    }

    public Task EditAsynch(AuditUserDetails auditUserDetails, CustomField customField, CancellationToken cancellationToken)
    {
        throw new NotImplementedException();
    }

    public Task CreateAsync(AuditUserDetails auditUserDetails, CustomField customField, CancellationToken cancellationToken)
    {
        throw new NotImplementedException();
    }

    public IQueryable<CustomField> GetCustomFieldList()
    {
        throw new NotImplementedException();
    }

    public Task<int> AddAdhocAuditEntry(AuditUserDetails auditUserDetails, AuditType auditType, Dictionary<string, Change> fields, CancellationToken cancellationToken)
    {
        throw new NotImplementedException();
    }
}