53 lines
1.2 KiB
Kotlin
53 lines
1.2 KiB
Kotlin
package de.pheerai.rcdbquery.dataMappings
|
|
|
|
import kotlin.test.Test
|
|
import kotlin.test.assertEquals
|
|
import kotlin.test.assertNull
|
|
|
|
class VendorTest {
|
|
@Test
|
|
fun testQueryParam() {
|
|
assertEquals(
|
|
"mk=6837",
|
|
Vendor.INTAMIN.queryParam
|
|
)
|
|
}
|
|
|
|
@Test
|
|
fun testQueryParamsGeneration() {
|
|
assertEquals(
|
|
"mk=6837&mk=6836",
|
|
Vendor.createQueryParam(Vendor.INTAMIN, Vendor.VEKOMA),
|
|
"Generation by Enum lookup failed."
|
|
)
|
|
assertEquals(
|
|
"mk=6836&mk=6856&mk=6905",
|
|
Vendor.createQueryParam("Ma"),
|
|
"Generation by name search failed."
|
|
)
|
|
}
|
|
|
|
@Test
|
|
fun testGetByName() {
|
|
assertEquals(
|
|
Vendor.INTAMIN,
|
|
Vendor.getByName("Intamin")
|
|
)
|
|
assertNull(
|
|
Vendor.getByName("asdf anjfejasdnf njnas")
|
|
)
|
|
}
|
|
|
|
@Test
|
|
fun testSearchByName() {
|
|
assertEquals(
|
|
listOf(Vendor.VEKOMA, Vendor.MACK, Vendor.MAURER),
|
|
Vendor.searchByName("ma")
|
|
)
|
|
assertEquals(
|
|
listOf(),
|
|
Vendor.searchByName("asdf anjfejasdnf njnas")
|
|
)
|
|
}
|
|
}
|