All Downloads are FREE. Search and download functionalities are using the official Maven repository.

jvmTest.com.bkahlert.kommons.test.junit.DisplayNameResolverTest.kt Maven / Gradle / Ivy

There is a newer version: 2.8.0
Show newest version
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)"
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy