Created
July 10, 2022 09:52
-
-
Save hongbeomi/5db3e3788e0766f0af258fd52e19abeb 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
@Test | |
fun fetchData_loading() { | |
// 메인 디스패처 정지를 위해 pause | |
mainCoroutineRule.pauseDispatcher() | |
// 데이터 가져오기 | |
viewModel.fetch() | |
// 로딩 상태 체크 | |
assertEquals(true, viewModel.loading.getOrAwaitValue()) | |
// 메인 디스패처 다시 시작을 위해 resume | |
mainCoroutineRule.resumeDispatcher() | |
// 로딩 상태 체크 | |
assertEquals(false, viewModel.loading.getOrAwaitValue()) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment