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 79fd115f5e - Show all commits
6
@@ -457,9 +457,8 @@ class Repository(private val api: SelfossApi, private val appSettingsService: Ap
val newItems = getMaxItemsForBackground(ItemType.UNREAD)
val allItems = getMaxItemsForBackground(ItemType.ALL)
AmineB marked this conversation as resolved Outdated
Outdated
Review

I think that the DB handles the duplicates.

I think that the DB handles the duplicates.
Outdated
Review

Does it use the id to check for duplicates? If that is the case then all is good.

Does it use the id to check for duplicates? If that is the case then all is good.
val starredItems = getMaxItemsForBackground(ItemType.STARRED)
val fullItemsList = newItems + allItems + starredItems
insertDBItems(fullItemsList)
return fullItemsList
insertDBItems(newItems + allItems + starredItems)
return newItems
AmineB marked this conversation as resolved Outdated
Outdated
Review

This is useless.

This is useless.
} catch (e: Throwable) {
// We do nothing
}
Outdated
Review

As the function name describes, this must only return the new items.

As the function name describes, this must only return the new items.
Outdated
Review

Ops, you're right I made a mistake while changing things...

Ops, you're right I made a mistake while changing things...