🧪 [Testing] Add unit tests for OfflineCourseStorage#288
Conversation
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>
|
👋 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 New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
PlataformasInformaticas
left a comment
There was a problem hiding this comment.
this is in conflict and need a loot of changes
🧪 Testing Improvement: Adding OfflineCourseStorage tests
🎯 What:
Added missing unit tests for the
OfflineCourseStorageobject 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 correctdownloadedCourseIds: Verifies reading the list of downloaded course directoriessaveCourseManifestandloadDownloadedCourses: Covers full serialization and deserialization, including nestedSurveyDocument,SurveyQuestion, andSurveyChoicedata classes.resourceFileandfindExistingResourceFile: Covers paths of resource files and handling logic.deleteCourse: Covers deleting recursively offline courses directory content.markdownImageFileandlocalMarkdownImageUri: 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