using System.Diagnostics;
using ClaudeDo.Installer.Core.Interfaces;

namespace ClaudeDo.Installer.Tests.Core;

internal sealed class FakeProcessLauncher : IProcessLauncher
{
    private readonly Exception? _throwOnStart;

    public FakeProcessLauncher(Exception? throwOnStart = null)
    {
        _throwOnStart = throwOnStart;
    }

    public ProcessStartInfo? LastStartInfo { get; private set; }

    public void Start(ProcessStartInfo startInfo)
    {
        LastStartInfo = startInfo;
        if (_throwOnStart is not null) throw _throwOnStart;
    }
}
