From b651b2ed4d7d73edccb4e2b484606418adea8fec Mon Sep 17 00:00:00 2001 From: Pirate Cat Date: Tue, 7 Jan 2025 16:38:16 +1100 Subject: [PATCH] Update OfflineFirstTopicsRepositoryTest.kt Improve the unit test to do meaning comparisons instead of just comparing two empty lists. --- .../core/data/repository/OfflineFirstTopicsRepositoryTest.kt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/data/src/test/kotlin/com/google/samples/apps/nowinandroid/core/data/repository/OfflineFirstTopicsRepositoryTest.kt b/core/data/src/test/kotlin/com/google/samples/apps/nowinandroid/core/data/repository/OfflineFirstTopicsRepositoryTest.kt index d32f424d89..eb7ebbeecc 100644 --- a/core/data/src/test/kotlin/com/google/samples/apps/nowinandroid/core/data/repository/OfflineFirstTopicsRepositoryTest.kt +++ b/core/data/src/test/kotlin/com/google/samples/apps/nowinandroid/core/data/repository/OfflineFirstTopicsRepositoryTest.kt @@ -67,6 +67,10 @@ class OfflineFirstTopicsRepositoryTest { @Test fun offlineFirstTopicsRepository_topics_stream_is_backed_by_topics_dao() = testScope.runTest { + // After sync, topicDao.getTopicEntities().first() and subject.getTopics().first() + // will return non-empty lists. + subject.syncWith(synchronizer) + assertEquals( topicDao.getTopicEntities() .first()