package de.arxsilex.maptools.converter.desktop

import java.io.File
import kotlin.test.Test
import kotlin.test.assertEquals
import kotlin.test.assertTrue

class InputFileRejectionTest {
    @Test
    fun `names unreadable mapsforge file and preserves concrete reader reason`() {
        val file = File("regional-map.map").absoluteFile
        val inspection = inspectInputFile(file)

        val rejection = inputFileRejection(file, requireNotNull(inspection.exceptionOrNull()))

        assertEquals("regional-map.map", rejection.fileName)
        assertEquals(file.absolutePath, rejection.path)
        assertTrue(rejection.reason.isNotBlank())
    }
}
