test(downloadmanager): Phase 7 - add tests for download manager module#3611
Open
ksalhab89 wants to merge 2 commits intoquran:mainfrom
Open
test(downloadmanager): Phase 7 - add tests for download manager module#3611ksalhab89 wants to merge 2 commits intoquran:mainfrom
ksalhab89 wants to merge 2 commits intoquran:mainfrom
Conversation
- Add AudioManagerPresenterTest (8 tests) - Add SheikhAudioPresenterTest (37 tests) - Create fakes: FakeAudioCacheInvalidator, FakeAudioExtensionDecider, FakeDownloader, FakeQariDownloadInfoSource, FakeQuranFileManager - Refactor presenters to depend on QariDownloadInfoSource interface instead of concrete QariDownloadInfoManager - Add downloadedQariInfo() to QariDownloadInfoSource interface - Open AudioCacheInvalidator class/method for test subclassing - Add test dependencies to build.gradle.kts - Zero Mockito usage
- Extract AudioCacheInvalidatorInterface; revert open class hack - Separate FakeQariDownloadInfoSource flows (downloadedQariInfo vs filtered) - AudioManagerPresenterTest uses emitFiltered() for correct method coverage - Add missing test: sheikhInfo emits nothing for unknown qariId - Add missing test: download no-op when all suras downloaded + downloadDatabase=false - Fix misleading test name: gapped removal, not gapless
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
feature:downloadmanager(previously 0 tests, 27 source files)AudioManagerPresenter(flow mapping, sorting, filtering)SheikhAudioPresenter(download/remove flows, selection state, dialog state, file operations, edge cases)openmodifier toQariDownloadInfoSourceinterface method andAudioCacheInvalidatorfor testabilityNew fakes
FakeQariDownloadInfoSourceQariDownloadInfoSourceFakeDownloaderDownloaderFakeQuranFileManagerQuranFileManagerFakeAudioCacheInvalidatorAudioCacheInvalidatorFakeAudioExtensionDeciderAudioExtensionDeciderTest coverage highlights
SheikhAudioPresenter: download orchestration (skip already-downloaded, database-only), gapless vs gapped file removal, dialog state machine, selection toggle/clear, download status event mapping (progress/done/error/cancel)AudioManagerPresenter: sort by name, empty list, mapping from QariDownloadInfo to UI modelTest plan
./gradlew :feature:downloadmanager:testDebugUnitTest./gradlew :app:testMadaniDebugUnitTest(no regressions)grep -rn "@Mock" feature/downloadmanager/src/testreturns empty