From b344dbcb695caf9c50b682d1c97f6c4747c97a6e Mon Sep 17 00:00:00 2001 From: sathwikcs <85106054+sathwikcs@users.noreply.github.com> Date: Tue, 28 Jan 2025 17:12:06 +0530 Subject: [PATCH] updated the test case --- .../java/com/example/hpostesting/AutoDacViewModelTest.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/test/java/com/example/hpostesting/AutoDacViewModelTest.kt b/app/src/test/java/com/example/hpostesting/AutoDacViewModelTest.kt index ac90b68..9591475 100644 --- a/app/src/test/java/com/example/hpostesting/AutoDacViewModelTest.kt +++ b/app/src/test/java/com/example/hpostesting/AutoDacViewModelTest.kt @@ -16,12 +16,12 @@ package com.example.hpostesting import android.content.Context import android.content.SharedPreferences import androidx.arch.core.executor.testing.InstantTaskExecutorRule -import com.example.hpostesting.util.NetworkStatusLiveData import com.example.hpostesting.data.dao.HemoCubeDao import com.example.hpostesting.data.model.Response import com.example.hpostesting.data.model.diagnostics.DiagnosticsData import com.example.hpostesting.data.repository.Repository import com.example.hpostesting.presentation.autodac.AutoDacViewModel +import com.example.hpostesting.util.NetworkMonitor import io.mockk.* import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.ExperimentalCoroutinesApi @@ -43,7 +43,7 @@ class AutoDacViewModelTest { private val repository = mockk() private val context = mockk() private val sharedPreferences = mockk() - private val networkStatusLiveData = mockk() + private val networkStatusLiveData = mockk() @Before fun setup() { @@ -54,7 +54,7 @@ class AutoDacViewModelTest { every { context.getSystemService(any()) } returns networkStatusLiveData // Mocking the NetworkStatusLiveData - every { networkStatusLiveData.observe(any(), any()) } just Runs + every { networkStatusLiveData.startMonitoring() } just Runs every { hemoCubeDao.getAll() } returns mockk() // every { repository.addDiagnostics(any()) } returns Response.Success(Unit)