Check that the api is being used rather than the db
This commit is contained in:
parent
5853a19937
commit
60c24fc75a
@ -6,9 +6,7 @@ import bou.amine.apps.readerforselfossv2.model.SelfossModel
|
|||||||
import bou.amine.apps.readerforselfossv2.rest.SelfossApi
|
import bou.amine.apps.readerforselfossv2.rest.SelfossApi
|
||||||
import bou.amine.apps.readerforselfossv2.service.AppSettingsService
|
import bou.amine.apps.readerforselfossv2.service.AppSettingsService
|
||||||
import com.github.ln_12.library.ConnectivityStatus
|
import com.github.ln_12.library.ConnectivityStatus
|
||||||
import io.mockk.coEvery
|
import io.mockk.*
|
||||||
import io.mockk.every
|
|
||||||
import io.mockk.mockk
|
|
||||||
import kotlinx.coroutines.flow.MutableStateFlow
|
import kotlinx.coroutines.flow.MutableStateFlow
|
||||||
import kotlinx.coroutines.runBlocking
|
import kotlinx.coroutines.runBlocking
|
||||||
import kotlin.test.BeforeTest
|
import kotlin.test.BeforeTest
|
||||||
@ -64,6 +62,8 @@ class RepositoryTest() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
assertSame(repository.items.size, 1)
|
assertSame(repository.items.size, 1)
|
||||||
|
coVerify(exactly = 1) { api.getItems("unread", 0, null, null, null, null, any()) }
|
||||||
|
verify(exactly = 0) { db.itemsQueries.items().executeAsList()}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user