package de.krisenvorrat.app.ui.navigation

import org.junit.Assert.assertEquals
import org.junit.Assert.assertNull
import org.junit.Test

class ScreenTest {

    @Test
    fun test_itemListRoute_isSingleton() {
        // Given & When
        val route = Screen.ItemList

        // Then
        assertEquals(Screen.ItemList, route)
    }

    @Test
    fun test_itemFormRoute_withoutItemId_hasNullItemId() {
        // Given & When
        val route = Screen.ItemForm()

        // Then
        assertNull(route.itemId)
    }

    @Test
    fun test_itemFormRoute_withItemId_hasCorrectItemId() {
        // Given
        val expectedId = "test-item-123"

        // When
        val route = Screen.ItemForm(itemId = expectedId)

        // Then
        assertEquals(expectedId, route.itemId)
    }

    @Test
    fun test_categoryManagementRoute_isSingleton() {
        // Given & When
        val route = Screen.CategoryManagement

        // Then
        assertEquals(Screen.CategoryManagement, route)
    }

    @Test
    fun test_locationManagementRoute_isSingleton() {
        // Given & When
        val route = Screen.LocationManagement

        // Then
        assertEquals(Screen.LocationManagement, route)
    }

    @Test
    fun test_itemFormRoute_equality_sameItemId_areEqual() {
        // Given
        val route1 = Screen.ItemForm(itemId = "abc")
        val route2 = Screen.ItemForm(itemId = "abc")

        // Then
        assertEquals(route1, route2)
    }

    @Test
    fun test_itemFormRoute_equality_differentItemId_areNotEqual() {
        // Given
        val route1 = Screen.ItemForm(itemId = "abc")
        val route2 = Screen.ItemForm(itemId = "xyz")

        // Then
        assert(route1 != route2)
    }
}
