From 4966fb704e211ff1870a040f90d9b06700df6f99 Mon Sep 17 00:00:00 2001 From: davidoskky Date: Sun, 12 Mar 2023 17:26:28 +0100 Subject: [PATCH] Fix sources tests --- androidApp/src/test/kotlin/RepositoryTest.kt | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/androidApp/src/test/kotlin/RepositoryTest.kt b/androidApp/src/test/kotlin/RepositoryTest.kt index af41ab5..78b6ca9 100644 --- a/androidApp/src/test/kotlin/RepositoryTest.kt +++ b/androidApp/src/test/kotlin/RepositoryTest.kt @@ -300,10 +300,10 @@ class RepositoryTest { every { appSettingsService.isItemCachingEnabled() } returns true initializeRepository(MutableStateFlow(false)) - repository.setSourceFilter(SelfossModel.Source( + repository.setSourceFilter(SelfossModel.SourceDetail( 1, "Test", - 0, + null, listOf("tags"), SPOUT, "", @@ -615,7 +615,7 @@ class RepositoryTest { testSources = repository.getSourcesDetails() } - assertEquals(sources.map { SelfossModel.Source(it) }, testSources) + assertEquals(sources, testSources) assertNotEquals(sourcesDB.map { it.toView() }, testSources) coVerify(exactly = 1) { api.sourcesDetailed() } } @@ -625,6 +625,7 @@ class RepositoryTest { SelfossModel.SourceDetail( 1, "First source", + null, listOf("Test", "second"), SPOUT, "", @@ -634,6 +635,7 @@ class RepositoryTest { SelfossModel.SourceDetail( 2, "Second source", + null, listOf("second"), SPOUT, "", @@ -645,7 +647,6 @@ class RepositoryTest { SOURCE( "1", "First DB source", - 3, "Test,second", SPOUT, "", @@ -655,7 +656,6 @@ class RepositoryTest { SOURCE( "2", "Second source", - null, "second", SPOUT, "", @@ -684,7 +684,7 @@ class RepositoryTest { } coVerify(exactly = 1) { api.sourcesDetailed() } - assertNotEquals(sources.map { SelfossModel.Source(it) }, testSources) + assertNotEquals(sources, testSources) assertEquals(sourcesDB.map { it.toView() }, testSources) verify(atLeast = 1) { db.sourcesQueries.sources().executeAsList() } } @@ -701,7 +701,7 @@ class RepositoryTest { testSources = repository.getSourcesDetails() } - assertEquals(sources.map { SelfossModel.Source(it) }, testSources) + assertEquals(sources, testSources) coVerify(exactly = 1) { api.sourcesDetailed() } verify(exactly = 0) { db.sourcesQueries } } @@ -718,7 +718,7 @@ class RepositoryTest { testSources = repository.getSourcesDetails() } - assertEquals(sources.map { SelfossModel.Source(it) }, testSources) + assertEquals(sources, testSources) coVerify(exactly = 1) { api.sourcesDetailed() } verify(atLeast = 1) { db.sourcesQueries } } @@ -1105,7 +1105,7 @@ class RepositoryTest { private fun prepareSearch() { repository.setTagFilter(SelfossModel.Tag("Tag", "read", 0)) repository.setSourceFilter( - SelfossModel.Source( + SelfossModel.SourceDetail( 1, "First source", 5,