Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update OfflineFirstNewsRepositoryTest.kt #1799

Merged
merged 3 commits into from
Jan 8, 2025
Merged

Conversation

eyhgpt
Copy link
Contributor

@eyhgpt eyhgpt commented Jan 8, 2025

Improve the unit test to perform meaningful comparisons instead of simply comparing two empty lists.

In the unit test function offlineFirstNewsRepository_news_resources_stream_is_backed_by_news_resource_dao()

Both newsResourceDao.getNewsResources().first() and subject.getNewsResources().first() return an empty list. This is because subject.syncWith(synchronizer) is not called beforehand. It doesn't seem meaningful by just comparing two empty lists.

This PR adds a subject.syncWith(synchronizer) call before retrieving the lists, similar to PR #1798

eyhgpt added 2 commits January 8, 2025 11:02
Improve the unit test to perform meaningful comparisons instead of merely comparing two empty lists.
Remove the comments. A similar comment wasn't accpeted in my last PR.
…/core/data/repository/OfflineFirstNewsRepositoryTest.kt
@dturner dturner merged commit d35dc6c into android:main Jan 8, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants