using System.Collections.Generic;
using System.Linq.Expressions;
using Core.Db;
using Domain;
using Domain.Identity;
using EntityFrameworkCoreMock;
using Microsoft.EntityFrameworkCore;
using Moq;
using Moq.EntityFrameworkCore;

public static class MockDb
{
    private static DbContextOptions<PanakDbContext> DummyOptions { get; } = new DbContextOptionsBuilder<PanakDbContext>().Options;
    private static DbContextMock<PanakDbContext> Db { set; get; }
    private static Mock<DbSet<Account>> MockAccountsSet { set; get; }
    public static DbContextMock<PanakDbContext> GetInstance()
    {
        if (Db?.Object != null)
            return Db;
        var data = new List<Account>();
        Db = new DbContextMock<PanakDbContext>(DummyOptions);
        Db.CreateDbSetMock(x => x.Set<Account>(), new List<Account>());
        Db.CreateDbSetMock(x => x.Set<AccountRole>(), new List<AccountRole>());
        Db.CreateDbSetMock(x => x.Set<LoginToken>(), new List<LoginToken>());
        Db.CreateDbSetMock(x => x.Set<Role>(), new List<Role>());
        Db.CreateDbSetMock(x => x.Set<FcmToken>(), new List<FcmToken>());
        Db.CreateDbSetMock(x => x.Set<RefreshToken>(), new List<RefreshToken>());



        return Db;
    }
 
}