mirror of
https://github.com/element-hq/element-android
synced 2024-12-18 07:12:47 +03:00
Updating existing unit tests
This commit is contained in:
parent
0eae1bd505
commit
06d447247a
3 changed files with 7 additions and 7 deletions
|
@ -29,7 +29,6 @@ import org.matrix.android.sdk.api.util.Optional
|
|||
import org.matrix.android.sdk.api.util.toOptional
|
||||
import javax.inject.Inject
|
||||
|
||||
// TODO update unit tests
|
||||
class GetDeviceFullInfoUseCase @Inject constructor(
|
||||
private val activeSessionHolder: ActiveSessionHolder,
|
||||
private val getCurrentSessionCrossSigningInfoUseCase: GetCurrentSessionCrossSigningInfoUseCase,
|
||||
|
|
|
@ -19,9 +19,9 @@ package im.vector.app.features.settings.devices.v2.overview
|
|||
import androidx.lifecycle.MutableLiveData
|
||||
import androidx.lifecycle.asFlow
|
||||
import im.vector.app.features.settings.devices.v2.CurrentSessionCrossSigningInfo
|
||||
import im.vector.app.features.settings.devices.DeviceFullInfo
|
||||
import im.vector.app.features.settings.devices.GetCurrentSessionCrossSigningInfoUseCase
|
||||
import im.vector.app.features.settings.devices.GetEncryptionTrustLevelForDeviceUseCase
|
||||
import im.vector.app.features.settings.devices.v2.DeviceFullInfo
|
||||
import im.vector.app.features.settings.devices.v2.GetCurrentSessionCrossSigningInfoUseCase
|
||||
import im.vector.app.features.settings.devices.v2.GetEncryptionTrustLevelForDeviceUseCase
|
||||
import im.vector.app.features.settings.devices.v2.list.CheckIfSessionIsInactiveUseCase
|
||||
import im.vector.app.test.fakes.FakeActiveSessionHolder
|
||||
import im.vector.app.test.fakes.FakeFlowLiveDataConversions
|
||||
|
@ -31,6 +31,7 @@ import io.mockk.mockk
|
|||
import io.mockk.unmockkAll
|
||||
import io.mockk.verify
|
||||
import kotlinx.coroutines.flow.firstOrNull
|
||||
import kotlinx.coroutines.flow.flowOf
|
||||
import kotlinx.coroutines.test.runTest
|
||||
import org.amshove.kluent.shouldBeEqualTo
|
||||
import org.junit.After
|
||||
|
@ -90,7 +91,7 @@ class GetDeviceFullInfoUseCaseTest {
|
|||
DeviceFullInfo(
|
||||
deviceInfo = deviceInfo,
|
||||
cryptoDeviceInfo = cryptoDeviceInfo,
|
||||
trustLevelForShield = trustLevel,
|
||||
roomEncryptionTrustLevel = trustLevel,
|
||||
isInactive = isInactive,
|
||||
)
|
||||
)
|
||||
|
@ -134,7 +135,7 @@ class GetDeviceFullInfoUseCaseTest {
|
|||
isCrossSigningInitialized = true,
|
||||
isCrossSigningVerified = false
|
||||
)
|
||||
every { getCurrentSessionCrossSigningInfoUseCase.execute() } returns currentSessionCrossSigningInfo
|
||||
every { getCurrentSessionCrossSigningInfoUseCase.execute() } returns flowOf(currentSessionCrossSigningInfo)
|
||||
return currentSessionCrossSigningInfo
|
||||
}
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ package im.vector.app.features.settings.devices.v2.overview
|
|||
|
||||
import com.airbnb.mvrx.Success
|
||||
import com.airbnb.mvrx.test.MvRxTestRule
|
||||
import im.vector.app.features.settings.devices.DeviceFullInfo
|
||||
import im.vector.app.features.settings.devices.v2.DeviceFullInfo
|
||||
import im.vector.app.test.fakes.FakeSession
|
||||
import im.vector.app.test.test
|
||||
import io.mockk.every
|
||||
|
|
Loading…
Reference in a new issue