using ClaudeDo.Worker.Runner; namespace ClaudeDo.Worker.Tests.Infrastructure; internal sealed class FakeClaudeProcess : IClaudeProcess { private readonly Func, Func, CancellationToken, Task> _handler; private int _callCount; public int CallCount => _callCount; public FakeClaudeProcess( Func, Func, CancellationToken, Task>? handler = null) { _handler = handler ?? ((_, _, _, _, _) => Task.FromResult(new RunResult { ExitCode = 0, ResultMarkdown = "ok" })); } public async Task RunAsync(IReadOnlyList arguments, string prompt, string workingDirectory, Func onStdoutLine, CancellationToken ct) { Interlocked.Increment(ref _callCount); return await _handler(prompt, workingDirectory, arguments, onStdoutLine, ct); } }