using RioJoy.Core.Protocol;
using Xunit;

namespace RioJoy.Core.Tests.Protocol;

public class RioLampStateTests
{
    [Fact]
    public void CommonCombos_MatchLegacyValues()
    {
        Assert.Equal(0x00, RioLampState.SolidOff);
        Assert.Equal(0x14, RioLampState.SolidDim);
        Assert.Equal(0x3C, RioLampState.SolidBright);
    }

    [Fact]
    public void Compose_AddsFlashAndBrightnessFields()
    {
        // flashMed(2) + field1 Dim(0x04) + field2 Bright(0x30) = 0x36
        byte state = RioLampState.Compose(LampFlash.FlashMed, LampField1.Dim, LampField2.Bright);
        Assert.Equal(0x36, state);
    }
}
