Skip to content

🧪 [Testing] Add unit tests for OfflineCourseStorage#288

Closed
dogi wants to merge 1 commit intomainfrom
add-offline-course-storage-tests-2233805322283675594
Closed

🧪 [Testing] Add unit tests for OfflineCourseStorage#288
dogi wants to merge 1 commit intomainfrom
add-offline-course-storage-tests-2233805322283675594

Conversation

@dogi
Copy link
Copy Markdown
Member

@dogi dogi commented Apr 10, 2026

🧪 Testing Improvement: Adding OfflineCourseStorage tests

🎯 What:
Added missing unit tests for the OfflineCourseStorage object which lacked them entirely. This component handles crucial app features for downloading, reading, writing, parsing, and storing courses for offline use on device storage.

📊 Coverage:

  • isCourseDownloaded: Verifies if course download status is correct
  • downloadedCourseIds: Verifies reading the list of downloaded course directories
  • saveCourseManifest and loadDownloadedCourses: Covers full serialization and deserialization, including nested SurveyDocument, SurveyQuestion, and SurveyChoice data classes.
  • resourceFile and findExistingResourceFile: Covers paths of resource files and handling logic.
  • deleteCourse: Covers deleting recursively offline courses directory content.
  • markdownImageFile and localMarkdownImageUri: Verifies markdown file URIs and file references.
  • availableStorageBytes: Verifies getting usable bytes.

Result:
Added comprehensive test coverage for offline course storage, catching possible future bugs when serializing and parsing these objects or using the offline directories. The test passes correctly, with accurate assertions on the stored and parsed results.


PR created automatically by Jules for task 2233805322283675594 started by @dogi

This commit adds a comprehensive suite of unit tests for `OfflineCourseStorage` using `RobolectricTestRunner`.

The tests cover all the public methods of the `OfflineCourseStorage` object, including checking downloaded courses, saving and loading manifests with complex objects like nested `SurveyDocument`, resource and markdown image files handling, computing storage size, and deleting courses.

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
@google-labs-jules
Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

Copy link
Copy Markdown
Collaborator

@PlataformasInformaticas PlataformasInformaticas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is in conflict and need a loot of changes

@dogi dogi closed this Apr 13, 2026
@PlataformasInformaticas PlataformasInformaticas deleted the add-offline-course-storage-tests-2233805322283675594 branch April 13, 2026 13:21
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