View Model Test
open class ViewModelTest
Content copied to clipboard
Base class for ViewModel testing.
Sample test:
class SampleViewModelTest : ViewModelTest() {
val mockViewState: SampleViewState = mockk()
lateinit var viewModel: SampleViewModel
@Before
fun setUp() {
viewModel = spyk(SampleViewModel(mockViewState), recordPrivateCalls = true)
}
@Test
fun `when ... then ...`() {
// GIVEN
...
// WHEN
...
// THEN
...
}}
Constructors
ViewModelTest
Link copied to clipboard
fun ViewModelTest()
Content copied to clipboard
Functions
Properties
coroutineScopeRule
Link copied to clipboard
instantTaskExecutorRule
Link copied to clipboard
rxJavaRule
Link copied to clipboard