Repository Unit Tests #50
@ -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> {
|
||||
|
Loading…
Reference in New Issue
Block a user