vendredi 27 novembre 2020

@Test gives unresolved reference - Kotlin

//kotlin snippet:
import kotlin.test.*
import kotlin.test.assertEquals

sealed class Transport
data class Train(val line: String) : Transport()

fun travel(transport: Transport) = "Train S1"

class TestTest {
@Test
fun `train travel`() {
    assertEquals("Train S1", travel(Train("S1")))
}
}

enter code heremain(){} //The dependencies are: /* dependencies { in build.gradle testCompile group: 'junit', name: 'junit', version: '4.12' testImplementation "org.jetbrains.kotlin:kotlin-test-common" testImplementation "org.jetbrains.kotlin:kotlin-test" testImplementation "org.jetbrains.kotlin:kotlin-test-junit" testImplementation "org.jetbrains.kotlin:kotlin-test-junit5" testImplementation "org.junit.jupiter:junit-jupiter:$junit_version" }*/

//Using IntelliJ 2020.2.3 Build Oct 6 2020 Version 11.0.8
//Why is compiler giving unresolved reference on @Test statement

Aucun commentaire:

Enregistrer un commentaire