Commit 84fd2772 authored by Jan Grigat's avatar Jan Grigat
Browse files

added example unittest

parent 1553dae6
......@@ -16,6 +16,9 @@ kotlin {
compilations.all {
kotlinOptions.jvmTarget = "11"
}
tasks.withType<Test> {
useJUnitPlatform()
}
}
sourceSets {
val jvmMain by getting{
......@@ -27,6 +30,16 @@ kotlin {
implementation(project(":common"))
}
}
val jvmTest by getting
val jvmTest by getting{
dependencies {
dependencies {
implementation(kotlin("test-common"))
implementation(kotlin("test-annotations-common"))
//implementation("org.junit.jupiter:junit-jupiter-api:5.7.0")
implementation("org.junit.jupiter:junit-jupiter:5.5.2")
}
}
}
}
}
import de.kompo.common.Store
import de.kompo.repo.mongo.MongoStoreRepo
import org.junit.jupiter.api.Test
class RepoTest {
@Test
fun testAddStore(){
val repo = MongoStoreRepo()
val target = Store("test")
repo.addStore(target)
repo.getStores().first { it.name == target.name && it.items.count() == target.items.count() }
}
}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment