jvmTest.com.bkahlert.kommons.test.junit.DisplayNameResolverTest.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of kommons-test Show documentation
Show all versions of kommons-test Show documentation
Kommons Test is a Kotlin Multiplatform Library to ease testing.
package com.bkahlert.kommons.test.junit
import com.bkahlert.kommons.test.test
import io.kotest.matchers.collections.shouldContainExactly
import io.kotest.matchers.shouldBe
import org.junit.jupiter.api.DisplayNameGeneration
import org.junit.jupiter.api.DisplayNameGenerator
import org.junit.jupiter.api.Nested
import org.junit.jupiter.api.Test
@DisplayNameGeneration(DisplayNameGenerator.Standard::class)
class DisplayNameResolverTest {
@Test fun test_name(displayName: DisplayName) = test {
displayName.ancestorDisplayNames.shouldContainExactly("JUnit Jupiter", "DisplayNameResolverTest")
displayName.displayName shouldBe "test_name(DisplayName)"
}
@Nested
inner class NestedTest {
@Test fun test_name(displayName: DisplayName) = test {
displayName.ancestorDisplayNames.shouldContainExactly("JUnit Jupiter", "DisplayNameResolverTest", "NestedTest")
displayName.displayName shouldBe "test_name(DisplayName)"
}
}
}