Repository Unit Tests #50

Merged
AmineB merged 38 commits from davidoskky/ReaderForSelfoss-multiplatform:repository_tests into master 2022-09-30 11:31:55 +00:00
Showing only changes of commit 3f0a3903ae - Show all commits

View File

@ -680,6 +680,18 @@ class RepositoryTest() {
coVerify(exactly = 0) { api.login() }
assertSame(false, response)
}
@Test
fun `refresh login information`() {
coEvery { api.refreshLoginInformation() } returns Unit
coEvery { appSettingsService.refreshLoginInformation(any(), any(), any()) } returns Unit
val repository = Repository(api, appSettingsService, connectivityStatus, db)
repository.refreshLoginInformation("https://test.com/selfoss/", "login", "password")
coVerify(exactly = 1) { api.refreshLoginInformation() }
coVerify(exactly = 1) {appSettingsService.refreshLoginInformation("https://test.com/selfoss/", "login", "password")}
}
}
fun generateTestDBItems(item : FakeItemParameters = FakeItemParameters()) : List<ITEM> {