commonTest.com.bkahlert.kommons.test.RootCauseKtTest.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
import kotlin.test.Test
class RootCauseKtTest {
@Test fun root_cause() = testAll(
IllegalArgumentException("error message"),
IllegalStateException(IllegalArgumentException("error message")),
RuntimeException(IllegalStateException(IllegalArgumentException("error message"))),
Error(RuntimeException(IllegalStateException(IllegalArgumentException("error message")))),
RuntimeException(Error(RuntimeException(IllegalStateException(IllegalArgumentException("error message"))))),
) { ex ->
ex.shouldHaveRootCauseInstanceOf()
ex.shouldHaveRootCauseMessage("error message")
}
}