using System.Collections.Concurrent; using ClaudeDo.Worker.Skills; namespace ClaudeDo.Worker.Tests.Infrastructure; public sealed class FakeSessionSkillSeeder : ISessionSkillSeeder { public int CallCount; public readonly record struct Call(string WorkingDir, IReadOnlyList SkillNames, bool IsWorktree); public readonly ConcurrentQueue Calls = new(); // Lets a test simulate a seeding failure (e.g. a broken skill install) to verify callers // don't leave a task stuck Running when SeedAsync throws. public Exception? ThrowOnSeed; public Task SeedAsync(string workingDir, IReadOnlyList skillNames, bool isWorktree, CancellationToken ct) { Interlocked.Increment(ref CallCount); Calls.Enqueue(new Call(workingDir, skillNames, isWorktree)); if (ThrowOnSeed is not null) throw ThrowOnSeed; return Task.CompletedTask; } }