annotation class Test
Marks a function to be executed as a Test
This can be used in AnnotationSpec to mark a function to be executed as a test by Kotest Engine.
expected can be used to mark a test to expect a specific exception.
This is useful when moving from JUnit, in which you use expected to verify for an exception.
@Test(expected = FooException::class)
fun foo() {
throw FooException() // Pass
}
@Test(expected = FooException::class
fun bar() {
throw BarException() // Fails, FooException was expected
}
None |
object None : Throwable |
<init> |
Marks a function to be executed as a Test Test(expected: KClass<out Throwable> = None::class) |
expected |
val expected: KClass<out Throwable> |