using System.Collections.Generic;
using PolyTrader.Core.Persistence;
using PolyTraderSharp.Models;

namespace PolyTrader.Tests.Fakes
{
    /// <summary>No-op-Stub für <see cref="IMarketRepository"/> (Engine-Tests nutzen den MarketCache).</summary>
    public sealed class FakeMarketRepository : IMarketRepository
    {
        public MarketData? GetById(string id) => null;
        public MarketData? FindByTokenId(string tokenId) => null;
        public List<MarketData> GetActive() => new();
        public void Upsert(MarketData market) { }
        public void Insert(MarketData market) { }
        public void Update(MarketData market) { }
        public void EnsureIndexes() { }
    }

    /// <summary>In-Memory-Stub für <see cref="IAccountRepository"/>.</summary>
    public sealed class FakeAccountRepository : IAccountRepository
    {
        public List<(int AccountId, decimal Balance)> Upserts { get; } = new();
        public List<AccountState> GetAll() => new();
        public void Upsert(AccountState account) => Upserts.Add((account.AccountId, account.AvailableBalance));
        public void Delete(int accountId) { }
    }
}
