diff --git a/course/src/test/java/org/openedx/course/presentation/container/CourseContainerViewModelTest.kt b/course/src/test/java/org/openedx/course/presentation/container/CourseContainerViewModelTest.kt index c1f4d0512..c28d38459 100644 --- a/course/src/test/java/org/openedx/course/presentation/container/CourseContainerViewModelTest.kt +++ b/course/src/test/java/org/openedx/course/presentation/container/CourseContainerViewModelTest.kt @@ -239,51 +239,6 @@ class CourseContainerViewModelTest { Dispatchers.resetMain() } - @Test - fun `getCourseEnrollmentDetails internet connection exception`() = runTest { - val viewModel = CourseContainerViewModel( - "", - "", - "", - appData, - config, - interactor, - calendarManager, - resourceManager, - courseNotifier, - iapNotifier, - networkConnection, - corePreferences, - coursePreferences, - analytics, - imageProcessor, - courseRouter - ) - every { networkConnection.isOnline() } returns true - coEvery { interactor.getEnrollmentDetails(any()) } throws UnknownHostException() - every { - analytics.logScreenEvent( - CourseAnalyticsEvent.DASHBOARD.eventName, - any() - ) - } returns Unit - viewModel.fetchCourseDetails() - advanceUntilIdle() - - coVerify(exactly = 1) { interactor.getEnrollmentDetails(any()) } - verify(exactly = 1) { - analytics.logScreenEvent( - CourseAnalyticsEvent.DASHBOARD.eventName, - any() - ) - } - - val message = viewModel.errorMessage.value - assertEquals(noInternet, message) - assert(!viewModel.refreshing.value) - assert(viewModel.courseAccessStatus.value == null) - } - @Test fun `getCourseEnrollmentDetails unknown exception`() = runTest { val viewModel = CourseContainerViewModel( @@ -412,38 +367,6 @@ class CourseContainerViewModelTest { assert(viewModel.courseAccessStatus.value != null) } - @Test - fun `updateData no internet connection exception`() = runTest { - val viewModel = CourseContainerViewModel( - "", - "", - "", - appData, - config, - interactor, - calendarManager, - resourceManager, - courseNotifier, - iapNotifier, - networkConnection, - corePreferences, - coursePreferences, - analytics, - imageProcessor, - courseRouter - ) - coEvery { interactor.getCourseStructure(any(), true) } throws UnknownHostException() - coEvery { courseNotifier.send(CourseStructureUpdated("")) } returns Unit - viewModel.updateData() - advanceUntilIdle() - - coVerify(exactly = 1) { interactor.getCourseStructure(any(), true) } - - val message = viewModel.errorMessage.value - assertEquals(noInternet, message) - assert(!viewModel.refreshing.value) - } - @Test fun `updateData unknown exception`() = runTest { val viewModel = CourseContainerViewModel(