package com.foxx.androidcast.remoteaccess;

import org.junit.Test;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;

public class RemoteAccessModeTest {

    @Test
    public void fromStored_noneAlias() {
        assertEquals(RemoteAccessMode.DISABLED, RemoteAccessMode.fromStored("none"));
    }

    @Test
    public void fromStored_wireguard() {
        assertEquals(RemoteAccessMode.WIREGUARD, RemoteAccessMode.fromStored("WIREGUARD"));
    }

    @Test
    public void toApiValue_wireguard() {
        assertEquals("wireguard", RemoteAccessMode.WIREGUARD.toApiValue());
    }

    @Test
    public void toApiValue_disabled() {
        assertEquals("none", RemoteAccessMode.DISABLED.toApiValue());
    }

    @Test
    public void toApiValue_rssh() {
        assertEquals("rssh", RemoteAccessMode.RSSH.toApiValue());
    }

    @Test
    public void isActive_wireguardAndRssh() {
        assertFalse(RemoteAccessMode.DISABLED.isActive());
        assertTrue(RemoteAccessMode.WIREGUARD.isActive());
        assertTrue(RemoteAccessMode.RSSH.isActive());
    }
}
