package com.correx.testing.contracts.model

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

class TransitionIdTest {

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

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

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

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

        assertEquals(a, b)
    }
}
