21 lines
569 B
Kotlin
21 lines
569 B
Kotlin
package fr.dcproject
|
|
|
|
import io.ktor.http.HttpMethod
|
|
import io.ktor.http.HttpStatusCode
|
|
import io.ktor.server.testing.handleRequest
|
|
import io.ktor.server.testing.withTestApplication
|
|
import kotlin.test.Test
|
|
import kotlin.test.assertEquals
|
|
|
|
class ApplicationTest {
|
|
@Test
|
|
fun testRoot() {
|
|
withTestApplication({ module(testing = true) }) {
|
|
handleRequest(HttpMethod.Get, "/articles").apply {
|
|
assertEquals(HttpStatusCode.OK, response.status())
|
|
assertEquals("todo", response.content)
|
|
}
|
|
}
|
|
}
|
|
}
|