namespace Recordingtest.Player.Tests; internal sealed class FakePlayerHost : IPlayerHost { public Func ResolveImpl { get; set; } = _ => new ResolvedElement(new ElementBounds(100, 200, 50, 40), null); public Func WaitForImpl { get; set; } = _ => true; public List Clicks { get; } = new(); public List Types { get; } = new(); public List<(ScreenPoint From, ScreenPoint To)> Drags { get; } = new(); public List Hotkeys { get; } = new(); public List<(int AfterStep, string SaveAs)> Checkpoints { get; } = new(); public List<(int StepIndex, string Reason)> Failures { get; } = new(); public List Resolved { get; } = new(); public List WaitedFor { get; } = new(); public ResolvedElement? ResolveElement(string uiaPath, TimeSpan timeout) { Resolved.Add(uiaPath); return ResolveImpl(uiaPath); } public bool WaitFor(string waitForHint, TimeSpan timeout) { WaitedFor.Add(waitForHint); return WaitForImpl(waitForHint); } public void Click(ScreenPoint point) => Clicks.Add(point); public void Type(string text) => Types.Add(text); public void Drag(ScreenPoint from, ScreenPoint to) => Drags.Add((from, to)); public void Hotkey(string keys) => Hotkeys.Add(keys); public void CaptureCheckpoint(int afterStep, string saveAs) => Checkpoints.Add((afterStep, saveAs)); public void CaptureFailureArtifacts(int stepIndex, string reason) => Failures.Add((stepIndex, reason)); }