class ViewModelScenario<VM : ViewModel> : AutoCloseable


ViewModelScenario provides API to start and drive a ViewModel's lifecycle state for testing.

Summary

Public functions

open Unit

Finishes the managed ViewModel and clear the ViewModelStore.

Public properties

VM

The current ViewModel.

Public functions

close

Added in 2.9.0-alpha01
open fun close(): Unit

Finishes the managed ViewModel and clear the ViewModelStore.

Public properties

viewModel

Added in 2.9.0-alpha01
val viewModel: VM

The current ViewModel. The instance might update if the ViewModelStore is cleared.