I was writing Unittest in Kotlin tutorial, but it seems that import fails and I cannot execute it.
How can I do this?
The environmental and source codes are as follows:
Kotlin:kotlinc-jvm1.3.11 (JRE 10.0.2+13)
IDE: InteliJ IDEA 2018.3
src/test/kotlin/bj1/CardTest.kt
package bj1
import org.junit.Test
import kotlin.test.assertEquals
classCardTest{
@ Test
US>funt1(){
valc1 = Card(1,1)
valc2 = Card (13,4)
assertEqual(1,c1.value)
assertEqual(1,c1.suit)
assertEqual (13, c2.value)
assertEqual(4,c2.suit)
}
}
build.gradle
plugins{
id'java'
id'org.jetbrains.kotlin.jvm'version '1.3.10'
}
group 'cc.hiroga'
version '1.0 - SNAPSHOT'
sourceCompatibility=1.8
repositories {
mavenCentral()
}
dependencies {
compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
testCompile group: 'junit', name: 'junit', version: '4.12'
testCompile "prg.jetbrains.kotlin:kotlin-test-junit"
}
compileKotlin{
kotlinOptions.jvmTarget="1.8"
}
compileTestKotlin{
kotlinOptions.jvmTarget="1.8"
}
Please let me know if you need any other information.
Thank you for your cooperation.
It may have already been resolved, but I think it will be fixed by correcting the following two types of typo.
.src/build.gradle
testCompile"prg.jetbrains.kotlin:kotlin-test-junit"
testCompile "org.jetbrains.kotlin:kotlin-test-junit"
src/test/kotlin/bj1/CardTest.kt
assertEqual
assertEquals
© 2024 OneMinuteCode. All rights reserved.