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

View File

@ -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

I think that the DB handles the duplicates.

I think that the DB handles the duplicates.

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

This is useless.

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

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

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

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

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