Skip to content

Commit 798b941

Browse files
authored
Update OfflineFirstNewsRepositoryTest.kt
Improve the unit test to perform meaningful comparisons instead of merely comparing two empty lists.
1 parent 904e6fc commit 798b941

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

core/data/src/test/kotlin/com/google/samples/apps/nowinandroid/core/data/repository/OfflineFirstNewsRepositoryTest.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,10 @@ class OfflineFirstNewsRepositoryTest {
8989
@Test
9090
fun offlineFirstNewsRepository_news_resources_stream_is_backed_by_news_resource_dao() =
9191
testScope.runTest {
92+
// After sync, newsResourceDao.getNewsResources().first() and
93+
// subject.getNewsResources().first() will return non-empty lists.
94+
subject.syncWith(synchronizer)
95+
9296
assertEquals(
9397
newsResourceDao.getNewsResources()
9498
.first()

0 commit comments

Comments
 (0)