Skip to content

Commit

Permalink
fix: added missing parameter in CapabilityViewModel unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
JuancaG05 committed Jan 7, 2025
1 parent 1f42c4d commit 4a3812d
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import androidx.lifecycle.MutableLiveData
import com.owncloud.android.domain.UseCaseResult
import com.owncloud.android.domain.capabilities.model.OCCapability
import com.owncloud.android.domain.capabilities.usecases.GetCapabilitiesAsLiveDataUseCase
import com.owncloud.android.domain.capabilities.usecases.GetStoredCapabilitiesUseCase
import com.owncloud.android.domain.capabilities.usecases.RefreshCapabilitiesFromServerAsyncUseCase
import com.owncloud.android.domain.utils.Event
import com.owncloud.android.presentation.common.UIResult
Expand Down Expand Up @@ -62,6 +63,7 @@ class CapabilityViewModelTest {

private lateinit var getCapabilitiesAsLiveDataUseCase: GetCapabilitiesAsLiveDataUseCase
private lateinit var refreshCapabilitiesFromServerUseCase: RefreshCapabilitiesFromServerAsyncUseCase
private lateinit var getStoredCapabilitiesUseCase: GetStoredCapabilitiesUseCase
private lateinit var ocContextProvider: ContextProvider

private val capabilitiesLiveData = MutableLiveData<OCCapability>()
Expand Down Expand Up @@ -111,13 +113,15 @@ class CapabilityViewModelTest {
private fun initTest() {
getCapabilitiesAsLiveDataUseCase = spyk(mockkClass(GetCapabilitiesAsLiveDataUseCase::class))
refreshCapabilitiesFromServerUseCase = spyk(mockkClass(RefreshCapabilitiesFromServerAsyncUseCase::class))
getStoredCapabilitiesUseCase = spyk(mockkClass(GetStoredCapabilitiesUseCase::class))

every { getCapabilitiesAsLiveDataUseCase(any()) } returns capabilitiesLiveData

capabilityViewModel = CapabilityViewModel(
accountName = testAccountName,
getCapabilitiesAsLiveDataUseCase = getCapabilitiesAsLiveDataUseCase,
refreshCapabilitiesFromServerAsyncUseCase = refreshCapabilitiesFromServerUseCase,
getStoredCapabilitiesUseCase = getStoredCapabilitiesUseCase,
coroutineDispatcherProvider = coroutineDispatcherProvider
)
}
Expand Down

0 comments on commit 4a3812d

Please sign in to comment.