From b687328567688e928726fbb8e522cf92a16aaecd Mon Sep 17 00:00:00 2001 From: Simon Marquis Date: Wed, 31 Jan 2024 10:45:45 +0100 Subject: [PATCH] Replace comments with proper `@TestOnly` annotations --- .../testing/repository/TestSearchContentsRepository.kt | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/core/testing/src/main/kotlin/com/google/samples/apps/nowinandroid/core/testing/repository/TestSearchContentsRepository.kt b/core/testing/src/main/kotlin/com/google/samples/apps/nowinandroid/core/testing/repository/TestSearchContentsRepository.kt index 4a3baba44..5436cd10f 100644 --- a/core/testing/src/main/kotlin/com/google/samples/apps/nowinandroid/core/testing/repository/TestSearchContentsRepository.kt +++ b/core/testing/src/main/kotlin/com/google/samples/apps/nowinandroid/core/testing/repository/TestSearchContentsRepository.kt @@ -24,6 +24,7 @@ import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.combine import kotlinx.coroutines.flow.update +import org.jetbrains.annotations.TestOnly class TestSearchContentsRepository : SearchContentsRepository { @@ -46,14 +47,10 @@ class TestSearchContentsRepository : SearchContentsRepository { override fun getSearchContentsCount(): Flow = combine(cachedTopics, cachedNewsResources) { topics, news -> topics.size + news.size } - /** - * Test only method to add the topics to the stored list in memory - */ + @TestOnly fun addTopics(topics: List) = cachedTopics.update { it + topics } - /** - * Test only method to add the news resources to the stored list in memory - */ + @TestOnly fun addNewsResources(newsResources: List) = cachedNewsResources.update { it + newsResources } }