package com.bytelyst.platform

import org.junit.jupiter.api.Assertions.*
import org.junit.jupiter.api.Test

class BLKillSwitchResultTest {

    @Test
    fun `ok() should return not-disabled result`() {
        val result = BLKillSwitchClient.KillSwitchResult.ok()
        assertFalse(result.disabled)
        assertNull(result.message)
    }

    @Test
    fun `disabled result should have message`() {
        val result = BLKillSwitchClient.KillSwitchResult(
            disabled = true,
            message = "Under maintenance"
        )
        assertTrue(result.disabled)
        assertEquals("Under maintenance", result.message)
    }

    @Test
    fun `default result should not be disabled`() {
        val result = BLKillSwitchClient.KillSwitchResult()
        assertFalse(result.disabled)
        assertNull(result.message)
    }

    @Test
    fun `data class copy should work`() {
        val original = BLKillSwitchClient.KillSwitchResult.ok()
        val modified = original.copy(disabled = true, message = "Updating")
        assertTrue(modified.disabled)
        assertEquals("Updating", modified.message)
    }
}
