# androidx.navigationevent.testing

*** ** * ** ***

Kotlin \|[Java](https://developer.android.com/reference/androidx/navigationevent/testing/package-summary "View this page in Java") Common/All

## Classes

|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/navigationevent/testing/TestNavigationEventDispatcherOwner` | A test implementation of `https://developer.android.com/reference/kotlin/androidx/navigationevent/NavigationEventDispatcherOwner` for verifying `https://developer.android.com/reference/kotlin/androidx/navigationevent/NavigationEventDispatcher` interactions. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/navigationevent/testing/TestNavigationEventHandler` | A test implementation of `https://developer.android.com/reference/kotlin/androidx/navigationevent/NavigationEventHandler` that records received events and invocation counts. | Cmn |

## Top-level functions summary

|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/navigationevent/testing/TestNavigationEventHandler<*>` | `https://developer.android.com/reference/kotlin/androidx/navigationevent/testing/package-summary#TestNavigationEventHandler(kotlin.Boolean,kotlin.Function2,kotlin.Function2,kotlin.Function1,kotlin.Function1,kotlin.Boolean,kotlin.Function2,kotlin.Function2,kotlin.Function1,kotlin.Function1)( isForwardEnabled: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html, onForwardStarted: https://developer.android.com/reference/kotlin/androidx/navigationevent/testing/TestNavigationEventHandler<*>.(event: https://developer.android.com/reference/kotlin/androidx/navigationevent/NavigationEvent) -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html, onForwardProgressed: https://developer.android.com/reference/kotlin/androidx/navigationevent/testing/TestNavigationEventHandler<*>.(event: https://developer.android.com/reference/kotlin/androidx/navigationevent/NavigationEvent) -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html, onForwardCancelled: https://developer.android.com/reference/kotlin/androidx/navigationevent/testing/TestNavigationEventHandler<*>.() -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html, onForwardCompleted: https://developer.android.com/reference/kotlin/androidx/navigationevent/testing/TestNavigationEventHandler<*>.() -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html, isBackEnabled: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html, onBackStarted: https://developer.android.com/reference/kotlin/androidx/navigationevent/testing/TestNavigationEventHandler<*>.(event: https://developer.android.com/reference/kotlin/androidx/navigationevent/NavigationEvent) -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html, onBackProgressed: https://developer.android.com/reference/kotlin/androidx/navigationevent/testing/TestNavigationEventHandler<*>.(event: https://developer.android.com/reference/kotlin/androidx/navigationevent/NavigationEvent) -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html, onBackCancelled: https://developer.android.com/reference/kotlin/androidx/navigationevent/testing/TestNavigationEventHandler<*>.() -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html, onBackCompleted: https://developer.android.com/reference/kotlin/androidx/navigationevent/testing/TestNavigationEventHandler<*>.() -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html )` Creates an instance of `https://developer.android.com/reference/kotlin/androidx/navigationevent/testing/package-summary#TestNavigationEventHandler(kotlin.Boolean,kotlin.Function2,kotlin.Function2,kotlin.Function1,kotlin.Function1,kotlin.Boolean,kotlin.Function2,kotlin.Function2,kotlin.Function1,kotlin.Function1)` without requiring an explicit generic type. | Cmn |

## Top-level functions

### TestNavigationEventHandler

Cmn Artifact: [androidx.navigationevent:navigationevent-testing](https://developer.android.com/jetpack/androidx/releases/navigationevent) [View Source](https://cs.android.com/search?q=file:androidx/navigationevent/testing/TestNavigationEventHandler.kt+function:TestNavigationEventHandler) Added in [1.0.2](https://developer.android.com/jetpack/androidx/releases/navigationevent#1.0.2)

```
fun TestNavigationEventHandler(
    isForwardEnabled: Boolean = true,
    onForwardStarted: TestNavigationEventHandler<*>.(event: NavigationEvent) -> Unit = {},
    onForwardProgressed: TestNavigationEventHandler<*>.(event: NavigationEvent) -> Unit = {},
    onForwardCancelled: TestNavigationEventHandler<*>.() -> Unit = {},
    onForwardCompleted: TestNavigationEventHandler<*>.() -> Unit = {},
    isBackEnabled: Boolean = true,
    onBackStarted: TestNavigationEventHandler<*>.(event: NavigationEvent) -> Unit = {},
    onBackProgressed: TestNavigationEventHandler<*>.(event: NavigationEvent) -> Unit = {},
    onBackCancelled: TestNavigationEventHandler<*>.() -> Unit = {},
    onBackCompleted: TestNavigationEventHandler<*>.() -> Unit = {}
): TestNavigationEventHandler<*>
```

Creates an instance of `https://developer.android.com/reference/kotlin/androidx/navigationevent/testing/package-summary#TestNavigationEventHandler(kotlin.Boolean,kotlin.Function2,kotlin.Function2,kotlin.Function1,kotlin.Function1,kotlin.Boolean,kotlin.Function2,kotlin.Function2,kotlin.Function1,kotlin.Function1)` without requiring an explicit generic type.

This function is a convenience wrapper around the `https://developer.android.com/reference/kotlin/androidx/navigationevent/testing/package-summary#TestNavigationEventHandler(kotlin.Boolean,kotlin.Function2,kotlin.Function2,kotlin.Function1,kotlin.Function1,kotlin.Boolean,kotlin.Function2,kotlin.Function2,kotlin.Function1,kotlin.Function1)` constructor that defaults its info type to `*`. Use this in tests where the specific type of `https://developer.android.com/reference/kotlin/androidx/navigationevent/NavigationEventInfo` is not relevant.