mirror of
https://github.com/element-hq/element-android
synced 2024-11-24 02:15:35 +03:00
Use a TestDispatcher in the FakeSession
This commit is contained in:
parent
5b3711b634
commit
8476fba5ff
3 changed files with 8 additions and 16 deletions
|
@ -16,21 +16,16 @@
|
|||
|
||||
package im.vector.app.features.location.domain.usecase
|
||||
|
||||
import com.airbnb.mvrx.test.MvRxTestRule
|
||||
import im.vector.app.features.location.LocationData
|
||||
import im.vector.app.test.fakes.FakeSession
|
||||
import io.mockk.MockKAnnotations
|
||||
import io.mockk.impl.annotations.OverrideMockKs
|
||||
import kotlinx.coroutines.test.runTest
|
||||
import org.junit.Before
|
||||
import org.junit.Rule
|
||||
import org.junit.Test
|
||||
|
||||
class CompareLocationsUseCaseTest {
|
||||
|
||||
@get:Rule
|
||||
val mvRxTestRule = MvRxTestRule()
|
||||
|
||||
private val session = FakeSession()
|
||||
|
||||
@OverrideMockKs
|
||||
|
|
|
@ -19,7 +19,6 @@ package im.vector.app.features.media.domain.usecase
|
|||
import android.content.Context
|
||||
import android.net.Uri
|
||||
import androidx.core.net.toUri
|
||||
import com.airbnb.mvrx.test.MvRxTestRule
|
||||
import im.vector.app.core.intent.getMimeTypeFromUri
|
||||
import im.vector.app.core.utils.saveMedia
|
||||
import im.vector.app.features.notifications.NotificationUtils
|
||||
|
@ -42,14 +41,10 @@ import io.mockk.verifyAll
|
|||
import kotlinx.coroutines.test.runTest
|
||||
import org.junit.After
|
||||
import org.junit.Before
|
||||
import org.junit.Rule
|
||||
import org.junit.Test
|
||||
|
||||
class DownloadMediaUseCaseTest {
|
||||
|
||||
@get:Rule
|
||||
val mvRxTestRule = MvRxTestRule()
|
||||
|
||||
@MockK
|
||||
lateinit var appContext: Context
|
||||
|
||||
|
|
|
@ -16,13 +16,15 @@
|
|||
|
||||
package im.vector.app.test
|
||||
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.test.UnconfinedTestDispatcher
|
||||
import org.matrix.android.sdk.api.MatrixCoroutineDispatchers
|
||||
|
||||
private val testDispatcher = UnconfinedTestDispatcher()
|
||||
|
||||
internal val testCoroutineDispatchers = MatrixCoroutineDispatchers(
|
||||
io = Dispatchers.Main,
|
||||
computation = Dispatchers.Main,
|
||||
main = Dispatchers.Main,
|
||||
crypto = Dispatchers.Main,
|
||||
dmVerif = Dispatchers.Main
|
||||
io = testDispatcher,
|
||||
computation = testDispatcher,
|
||||
main = testDispatcher,
|
||||
crypto = testDispatcher,
|
||||
dmVerif = testDispatcher
|
||||
)
|
||||
|
|
Loading…
Reference in a new issue