using DragonISO.Engine.Interop;
using DragonISO.Engine.Tests.Fakes;

namespace DragonISO.Engine.Tests.Interop;

public class NdiRuntimeProbeTests
{
    [Fact]
    public void Probe_VersionsMatch_ReturnsMatch()
    {
        var interop = new FakeNdiInterop { RuntimeVersion = "6.0.0" };
        var probe = new NdiRuntimeProbe(interop, expectedVersion: "6.0.0");

        var result = probe.Probe();

        result.Should().BeOfType<NdiRuntimeProbeResult.Match>();
    }

    [Fact]
    public void Probe_VersionsDiffer_ReturnsMismatchWithBoth()
    {
        var interop = new FakeNdiInterop { RuntimeVersion = "5.6.0" };
        var probe = new NdiRuntimeProbe(interop, expectedVersion: "6.0.0");

        var result = probe.Probe();

        result.Should().BeOfType<NdiRuntimeProbeResult.Mismatch>();
        var mismatch = (NdiRuntimeProbeResult.Mismatch)result;
        mismatch.Detected.Should().Be("5.6.0");
        mismatch.Expected.Should().Be("6.0.0");
    }
}
