TestNavigationEventDispatcherOwner



A test implementation of NavigationEventDispatcherOwner for verifying NavigationEventDispatcher interactions.

Use this class in tests to confirm that back-press fallbacks and callback status changes are invoked as expected. It tracks the number of times these events occur via public counters.

Summary

Public constructors

TestNavigationEventDispatcherOwner(
    fallbackOnBackPressed: TestNavigationEventDispatcherOwner.() -> Unit,
    onHasEnabledCallbacksChanged: TestNavigationEventDispatcherOwner.() -> Unit
)
Cmn

Public constructors

TestNavigationEventDispatcherOwner

TestNavigationEventDispatcherOwner(
    fallbackOnBackPressed: TestNavigationEventDispatcherOwner.() -> Unit = {},
    onHasEnabledCallbacksChanged: TestNavigationEventDispatcherOwner.() -> Unit = {}
)
Parameters
fallbackOnBackPressed: TestNavigationEventDispatcherOwner.() -> Unit = {}

A lambda invoked by the NavigationEventDispatcher when a back press occurs and no other callbacks handle it.

onHasEnabledCallbacksChanged: TestNavigationEventDispatcherOwner.() -> Unit = {}

A lambda invoked by the NavigationEventDispatcher when its NavigationEventDispatcher.hasEnabledCallbacks status changes.

Public properties

fallbackOnBackPressedInvocations

val fallbackOnBackPressedInvocationsInt

The number of times NavigationEventDispatcher.fallbackOnBackPressed has been invoked.

open val navigationEventDispatcherNavigationEventDispatcher

The NavigationEventDispatcher that should handle the navigation events.

onHasEnabledCallbacksChangedInvocations

val onHasEnabledCallbacksChangedInvocationsInt

The number of times NavigationEventDispatcher.onHasEnabledCallbacksChanged has been invoked.