Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class VariableAmountOfNetworkRequestsViewModel(
val recentVersions = mockApi.getRecentAndroidVersions()
val versionFeatures = recentVersions
.map { androidVersion ->
async { mockApi.getAndroidVersionFeatures(androidVersion.apiLevel) }
viewModelScope.async { mockApi.getAndroidVersionFeatures(androidVersion.apiLevel) }
}.awaitAll()
uiState.value = UiState.Success(versionFeatures)
} catch (exception: Exception) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ class VariableAmountOfNetworkRequestsViewModelTest {
}

@Test
fun `performNetworkRequestsConcurrently() should return Error UiState on successful network requests after 2000ms`() =
fun `performNetworkRequestsConcurrently() should return Success UiState on successful network requests after 2000ms`() =
mainCoroutineScopeRule.runBlockingTest {
val responseDelay = 1000L
val fakeApi = FakeSuccessApi(responseDelay)
Expand Down Expand Up @@ -147,7 +147,7 @@ class VariableAmountOfNetworkRequestsViewModelTest {

Assert.assertTrue(receivedUiStates.isEmpty())

viewModel.performNetworkRequestsSequentially()
viewModel.performNetworkRequestsConcurrently()

advanceUntilIdle()

Expand All @@ -170,7 +170,7 @@ class VariableAmountOfNetworkRequestsViewModelTest {

Assert.assertTrue(receivedUiStates.isEmpty())

viewModel.performNetworkRequestsSequentially()
viewModel.performNetworkRequestsConcurrently()

advanceUntilIdle()

Expand Down