package com.joe.camera.webcam.model

import org.junit.Assert.*
import org.junit.Test

class AppModelsTest {
    @Test fun `BLE command codes remain compatible with Flutter app`() {
        assertEquals(RemoteCommand.VOLUME_UP, RemoteCommand.fromCode(0))
        assertEquals(RemoteCommand.VOLUME_DOWN, RemoteCommand.fromCode(1))
        assertEquals(RemoteCommand.RECORD_VIDEO, RemoteCommand.fromCode(2))
        assertEquals(RemoteCommand.OPEN_SETTING, RemoteCommand.fromCode(3))
        assertNull(RemoteCommand.fromCode(9))
    }

    @Test fun `camera wire state maps busy and free`() {
        assertEquals(CameraState.FREE, CameraState.fromWire(0))
        assertEquals(CameraState.WORKING, CameraState.fromWire(1))
        assertEquals(1, CameraState.RECORDING.wireCode.toInt())
    }
}
