Cleaning.

This commit is contained in:
aminecmi 2022-12-14 21:07:03 +01:00
parent 284c19ef89
commit 9d58fba5c9

View File

@ -985,16 +985,7 @@ class RepositoryTest {
)
initializeRepository()
repository.setTagFilter(SelfossModel.Tag("Tag", "read", 0))
repository.setSourceFilter(SelfossModel.Source(
1,
"First source",
listOf("Test", "second"),
"spouts\\rss\\fulltextrss",
"",
"d8c92cdb1ef119ea85c4b9205c879ca7.png"
))
repository.searchFilter = "search"
prepareSearch()
runBlocking {
repository.tryToCacheItemsAndGetNewOnes()
}
@ -1008,16 +999,7 @@ class RepositoryTest {
StatusAndData(success = false, data = generateTestApiItem())
initializeRepository()
repository.setTagFilter(SelfossModel.Tag("Tag", "read", 0))
repository.setSourceFilter(SelfossModel.Source(
1,
"First source",
listOf("Test", "second"),
"spouts\\rss\\fulltextrss",
"",
"d8c92cdb1ef119ea85c4b9205c879ca7.png"
))
repository.searchFilter = "search"
prepareSearch()
runBlocking {
repository.tryToCacheItemsAndGetNewOnes()
}
@ -1031,20 +1013,26 @@ class RepositoryTest {
StatusAndData(success = false, data = generateTestApiItem())
initializeRepository(MutableStateFlow(false))
repository.setTagFilter(SelfossModel.Tag("Tag", "read", 0))
repository.setSourceFilter(SelfossModel.Source(
1,
"First source",
listOf("Test", "second"),
"spouts\\rss\\fulltextrss",
"",
"d8c92cdb1ef119ea85c4b9205c879ca7.png"
))
repository.searchFilter = "search"
prepareSearch()
runBlocking {
repository.tryToCacheItemsAndGetNewOnes()
}
coVerify(exactly = 0) { api.getItems(any(), 0, null, null, null, null, 200) }
}
private fun prepareSearch() {
repository.setTagFilter(SelfossModel.Tag("Tag", "read", 0))
repository.setSourceFilter(
SelfossModel.Source(
1,
"First source",
listOf("Test", "second"),
"spouts\\rss\\fulltextrss",
"",
"d8c92cdb1ef119ea85c4b9205c879ca7.png"
)
)
repository.searchFilter = "search"
}
}