package pl.firmatpp.kierowca.domain

import org.junit.Assert.assertEquals
import org.junit.Test
import pl.firmatpp.kierowca.data.model.DriverRouteDto

class RouteDisplayMapperTest {
    @Test
    fun mapsRouteToDriverCardText() {
        val route = DriverRouteDto(
            id = "42",
            startsAt = "09:15",
            originName = "TPP Baza Krakow",
            destinationName = "Instalacja Odpadowa Slask",
            contractorName = "TPP Baza Krakow",
            contractName = "Odpady przemyslowe",
            contractCode = "TPP-ODP-24",
            relationLabel = "TPP Baza Krakow -> Instalacja Odpadowa Slask",
            status = "ZAPLANOWANA",
            distanceKm = 91.4,
            notes = null,
            truck = null,
            photos = emptyList(),
        )

        val display = RouteDisplayMapper.toCard(route)

        assertEquals("TPP Baza Krakow", display.origin)
        assertEquals("Instalacja Odpadowa Slask", display.destination)
        assertEquals("TPP-ODP-24", display.contractLabel)
        assertEquals("09:15", display.time)
        assertEquals("91 km", display.distanceLabel)
    }
}
