using DragonISO.Engine.Pipeline;

namespace DragonISO.Engine.Tests.Pipeline;

public class SolidFrameRendererTests
{
    [Fact]
    public void Render_ProducesBgraFrameOfTargetSize_FilledWithColor()
    {
        var renderer = new SolidFrameRenderer();
        var frame = renderer.Render(width: 1920, height: 1080, b: 0x80, g: 0x80, r: 0x80, a: 0xFF, timestampTicks: 12345);

        frame.Width.Should().Be(1920);
        frame.Height.Should().Be(1080);
        frame.Format.Should().Be(PixelFormat.Bgra);
        frame.Pixels.Length.Should().Be(1920 * 1080 * 4);
        frame.TimestampTicks.Should().Be(12345);

        var span = frame.Pixels.Span;
        span[0].Should().Be(0x80); span[1].Should().Be(0x80); span[2].Should().Be(0x80); span[3].Should().Be(0xFF);
        var last = span.Length - 4;
        span[last].Should().Be(0x80); span[last + 3].Should().Be(0xFF);
    }
}
