From f86d174c1bb235bc4bfff9f424013545e4d4b23d Mon Sep 17 00:00:00 2001 From: Adetunji Dahunsi Date: Tue, 25 Apr 2023 05:44:59 -0400 Subject: [PATCH] Used more explicit variable names in tests Change-Id: I2e0ebead70441eced05eb786aaa7683bfefa8976 --- .../data/repository/OfflineFirstNewsRepositoryTest.kt | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/core/data/src/test/java/com/google/samples/apps/nowinandroid/core/data/repository/OfflineFirstNewsRepositoryTest.kt b/core/data/src/test/java/com/google/samples/apps/nowinandroid/core/data/repository/OfflineFirstNewsRepositoryTest.kt index 9e6834f8f..d3c1851f9 100644 --- a/core/data/src/test/java/com/google/samples/apps/nowinandroid/core/data/repository/OfflineFirstNewsRepositoryTest.kt +++ b/core/data/src/test/java/com/google/samples/apps/nowinandroid/core/data/repository/OfflineFirstNewsRepositoryTest.kt @@ -312,13 +312,15 @@ class OfflineFirstNewsRepositoryTest { subject.syncWith(synchronizer) + val followedNewsResourcesFromNetwork = networkNewsResources + .filter { (it.topics intersect followedTopicIds).isNotEmpty() } + .map(NetworkNewsResource::id) + .sorted() + // Notifier should have been called with only news resources that have topics // that the user follows assertEquals( - expected = networkNewsResources - .filter { (it.topics intersect followedTopicIds).isNotEmpty() } - .map(NetworkNewsResource::id) - .sorted(), + expected = followedNewsResourcesFromNetwork, actual = notifier.addedNewsResources.first().map(NewsResource::id).sorted(), ) }