using ClaudeDo.Worker.Usage;
using ClaudeDo.Worker.Usage.Interfaces;

namespace ClaudeDo.Worker.Tests.Infrastructure;

public sealed class FakeTranscriptUsageReader : ITranscriptUsageReader
{
    private readonly Dictionary<string, SessionUsageTotals> _totalsBySession = new();

    public void SetTotals(string sessionId, SessionUsageTotals totals) => _totalsBySession[sessionId] = totals;

    public Task<SessionUsageTotals?> ReadSessionTotalsAsync(string sessionId, CancellationToken ct = default) =>
        Task.FromResult(_totalsBySession.TryGetValue(sessionId, out var totals) ? totals : null);
}
