-
-
Save zsmb13/2c11c0b1200a17f7fad15e02831d4172 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright 2022 Google LLC. | |
// SPDX-License-Identifier: Apache-2.0 | |
// Example with the old APIs | |
@Test | |
fun loadTasks_loading() { | |
// Pause dispatcher so we can verify initial values | |
mainCoroutineRule.pauseDispatcher() | |
// Load the task in the viewmodel | |
statisticsViewModel.refresh() | |
// Then progress indicator is shown | |
assertThat(statisticsViewModel.dataLoading.getOrAwaitValue()).isTrue() | |
// Execute pending coroutine actions | |
mainCoroutineRule.resumeDispatcher() | |
// Then progress indicator is hidden | |
assertThat(statisticsViewModel.dataLoading.getOrAwaitValue()).isFalse() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment