mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-09-10 07:48:30 -04:00
Removed the deprecated method from SaveSearchToRecents.
This commit is contained in:
parent
87632c5f6a
commit
f16e579194
@ -23,9 +23,9 @@ import io.mockk.Called
|
|||||||
import io.mockk.mockk
|
import io.mockk.mockk
|
||||||
import io.mockk.verify
|
import io.mockk.verify
|
||||||
import kotlinx.coroutines.ExperimentalCoroutinesApi
|
import kotlinx.coroutines.ExperimentalCoroutinesApi
|
||||||
import kotlinx.coroutines.test.TestCoroutineScope
|
import kotlinx.coroutines.test.TestScope
|
||||||
import kotlinx.coroutines.test.advanceUntilIdle
|
import kotlinx.coroutines.test.advanceUntilIdle
|
||||||
import kotlinx.coroutines.test.runBlockingTest
|
import kotlinx.coroutines.test.runTest
|
||||||
import org.junit.jupiter.api.Test
|
import org.junit.jupiter.api.Test
|
||||||
import org.kiwix.kiwixmobile.core.dao.NewRecentSearchDao
|
import org.kiwix.kiwixmobile.core.dao.NewRecentSearchDao
|
||||||
import org.kiwix.kiwixmobile.core.reader.ZimFileReader
|
import org.kiwix.kiwixmobile.core.reader.ZimFileReader
|
||||||
@ -38,7 +38,7 @@ internal class SaveSearchToRecentsTest {
|
|||||||
private val searchListItem = RecentSearchListItem("", ZimFileReader.CONTENT_PREFIX)
|
private val searchListItem = RecentSearchListItem("", ZimFileReader.CONTENT_PREFIX)
|
||||||
|
|
||||||
private val activity: AppCompatActivity = mockk()
|
private val activity: AppCompatActivity = mockk()
|
||||||
private val testDispatcher = TestCoroutineScope()
|
private val testDispatcher = TestScope()
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun `invoke with null Id does nothing`() {
|
fun `invoke with null Id does nothing`() {
|
||||||
@ -54,7 +54,7 @@ internal class SaveSearchToRecentsTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun `invoke with non null Id saves search`() = testDispatcher.runBlockingTest {
|
fun `invoke with non null Id saves search`() = testDispatcher.runTest {
|
||||||
val id = "id"
|
val id = "id"
|
||||||
SaveSearchToRecents(
|
SaveSearchToRecents(
|
||||||
newRecentSearchDao,
|
newRecentSearchDao,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user