autodispose-lifecycle / com.uber.autodispose.lifecycle / TestLifecycleScopeProvider

TestLifecycleScopeProvider

class TestLifecycleScopeProvider : LifecycleScopeProvider<TestLifecycle>

Test utility to create LifecycleScopeProvider instances for tests.

Supports a start and stop lifecycle. Subscribing when outside of the lifecycle will throw either a LifecycleNotStartedException or LifecycleEndedException.

Types

TestLifecycle

class TestLifecycle

Functions

correspondingEvents

fun correspondingEvents(): CorrespondingEventsFunction<TestLifecycle>

create

static fun create(): TestLifecycleScopeProvider

createInitial

static fun createInitial(initialValue: TestLifecycle): TestLifecycleScopeProvider

lifecycle

fun lifecycle(): Observable<TestLifecycle>

peekLifecycle

fun peekLifecycle(): TestLifecycle?

requestScope

fun requestScope(): CompletableSource

start

fun start(): Unit

Start the test lifecycle.

stop

fun stop(): Unit

Stop the test lifecycle.