Package kotlin.test
Annotations to mark test functions and top-level functions for performing assertions in tests.
Types
Asserter
Abstracts the logic for performing assertions. Specific implementations of Asserter can use JUnit or TestNG assertion facilities.
interface Asserter
AsserterContributor
Checks applicability and provides Asserter instance
interface AsserterContributor
AssertionResult
Describes the result of an assertion execution.
interface AssertionResult
BeforeEach
typealias BeforeEach = BeforeTest
FrameworkAdapter
Serves as a bridge to a testing framework.
interface FrameworkAdapter
Annotations
AfterClass
Marks a function to be executed after a suite. Not supported in Kotlin/Common.
annotation class AfterClass
AfterTest
Marks a function to be invoked after each test.
annotation class AfterTest
typealias AfterTest = After
typealias AfterTest = AfterEach
typealias AfterTest = AfterMethod
BeforeClass
Marks a function to be executed before a suite. Not supported in Kotlin/Common.
annotation class BeforeClass
BeforeTest
Marks a function to be invoked before each test.
annotation class BeforeTest
typealias BeforeTest = Before
typealias BeforeTest = BeforeEach
typealias BeforeTest = BeforeMethod
Properties
Functions
assertFailsWith
assertFalse
Asserts that the given block returns false
.
assertNotNull
assertTrue
Asserts that the given block returns true
.
currentStackTrace
Returns an array of stack trace elements, each representing one stack frame. The first element of the array (assuming the array is not empty) represents the top of the stack, which is the place where currentStackTrace function was called from.
fun currentStackTrace(): Array<StackTraceElement!>!
DefaultAsserter
fun DefaultAsserter(): DefaultAsserter