mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-09-24 05:04:50 -04:00
#1258 inject test schedulers
This commit is contained in:
parent
3ab77f5ccd
commit
1ee18f4eb4
@ -29,11 +29,14 @@ import io.mockk.clearMocks
|
||||
import io.mockk.every
|
||||
import io.mockk.mockk
|
||||
import io.mockk.mockkStatic
|
||||
import io.reactivex.schedulers.Schedulers
|
||||
import org.assertj.core.api.Assertions.assertThat
|
||||
import org.junit.jupiter.api.AfterAll
|
||||
import org.junit.jupiter.api.BeforeEach
|
||||
import org.junit.jupiter.api.Nested
|
||||
import org.junit.jupiter.api.Test
|
||||
import org.kiwix.kiwixmobile.resetSchedulers
|
||||
import org.kiwix.kiwixmobile.setScheduler
|
||||
import java.io.File
|
||||
|
||||
class FileSearchTest {
|
||||
@ -47,6 +50,10 @@ class FileSearchTest {
|
||||
|
||||
private val unitTestTempDirectoryPath = "unittest${File.separator}"
|
||||
|
||||
init {
|
||||
setScheduler(Schedulers.trampoline())
|
||||
}
|
||||
|
||||
@BeforeEach
|
||||
fun init() {
|
||||
clearMocks(context, externalStorageDirectory, contentResolver, storageDevice)
|
||||
@ -66,6 +73,7 @@ class FileSearchTest {
|
||||
@AfterAll
|
||||
fun teardown() {
|
||||
deleteTempDirectory()
|
||||
resetSchedulers()
|
||||
}
|
||||
|
||||
@Nested
|
||||
|
Loading…
x
Reference in New Issue
Block a user