Package dispatch.test

Types

Link copied to clipboard
@ExperimentalCoroutinesApi
@ExtendWith(value = [CoroutineTestExtension::class])
annotation class CoroutineTest(scopeFactory: KClass<*>)

Annotation for specifying a custom CoroutineTestExtension.ScopeFactory while extending a test class or function with CoroutineTestExtension.

Link copied to clipboard
@ExperimentalCoroutinesApi
class CoroutineTestExtension(scopeFactory: CoroutineTestExtension.ScopeFactory) : TypeBasedParameterResolver<TestProvidedCoroutineScope> , BeforeEachCallback, AfterEachCallback

JUnit 5 ParameterResolverExtension for injecting and managing a TestProvidedCoroutineScope in a test instance. This creates a new instance of TestProvidedCoroutineScope each time the scope is injected, optionally using a custom ScopeFactory.

Functions

Link copied to clipboard
@ExperimentalCoroutinesApi
inline fun coroutineTestExtension(crossinline scopeFactory: () -> TestProvidedCoroutineScope = { TestProvidedCoroutineScope() }): CoroutineTestExtension

Factory function for creating a CoroutineTestExtension.