package com.correx.testing.contracts.model

import com.correx.core.events.types.StageId
import org.junit.jupiter.api.Assertions.assertEquals
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.assertThrows

class StageIdTest {

    @Test
    fun `rejects blank value`() {
        assertThrows<IllegalArgumentException> {
            StageId("")
        }
    }

    @Test
    fun `stores value correctly`() {
        val id = StageId("stage-1")

        assertEquals("stage-1", id.value)
        assertEquals("stage-1", id.toString())
    }

    @Test
    fun `value class equality works`() {
        val a = StageId("x")
        val b = StageId("x")

        assertEquals(a, b)
    }
}
