using System.Numerics;
namespace AcDream.UI.Abstractions.Tests;
///
/// In-memory test double for . Records every
/// widget call so tests can assert against the recorded trace without
/// running an ImGui context. New widgets added to the interface must
/// implement here too — that compilation error IS the TDD red signal.
///
internal sealed class FakePanelRenderer : IPanelRenderer
{
/// Ordered list of (method, args) pairs recorded across this renderer's lifetime.
public List<(string Method, object?[] Args)> Calls { get; } = new();
/// If is called, return this value. Defaults to true so panels render.
public bool BeginReturns { get; set; } = true;
// -- Inputs the panel under test can mutate via ref args -----------
/// Pre-set return value for the next — caller flips bool to simulate user click.
public bool CheckboxNextReturn { get; set; }
public bool? CheckboxNextValue { get; set; }
/// Pre-set return value for the next — caller sets to simulate user click.
public bool ButtonNextReturn { get; set; }
/// Pre-set return value for the next .
public bool ComboNextReturn { get; set; }
public int? ComboNextSelectedIndex { get; set; }
/// Pre-set return for .
public bool SliderFloatNextReturn { get; set; }
public float? SliderFloatNextValue { get; set; }
/// Pre-set return for .
public bool CollapsingHeaderNextReturn { get; set; } = true;
/// Pre-set return for .
public bool TreeNodeNextReturn { get; set; } = true;
/// Pre-set return for .
public bool BeginTableNextReturn { get; set; } = true;
/// Pre-set return for .
public bool BeginChildNextReturn { get; set; } = true;
/// Pre-set return value for .
public float FrameHeightWithSpacingValue { get; set; } = 24f;
/// Pre-set "submitted" string for the next ; null = no submit this frame.
public string? InputTextSubmitNextSubmitted { get; set; }
public string? InputTextSubmitNextBufferAfter { get; set; }
/// K.3: return value (default true).
public bool MainMenuBarReturns { get; set; } = true;
/// K.3: return value (default true).
public bool MenuReturns { get; set; } = true;
/// K.3: return value (default false — only true for the frame the user "clicks").
public bool MenuItemReturns { get; set; }
public bool Begin(string title)
{
Calls.Add(("Begin", new object?[] { title }));
return BeginReturns;
}
public void End() => Calls.Add(("End", Array.Empty