Test refresh login information
All checks were successful
continuous-integration/drone/pr Build is passing

This commit is contained in:
davidoskky 2022-09-26 22:50:55 +02:00
parent f46f98cef0
commit 3f0a3903ae

View File

@ -680,6 +680,18 @@ class RepositoryTest() {
coVerify(exactly = 0) { api.login() } coVerify(exactly = 0) { api.login() }
assertSame(false, response) 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> { fun generateTestDBItems(item : FakeItemParameters = FakeItemParameters()) : List<ITEM> {