Skip to content

Conversation

@rfc2822
Copy link
Member

@rfc2822 rfc2822 commented Nov 14, 2025

Add some missing tests

- Rename `testAddEventAndExceptions` to `testAddEventAndExceptions_and_GetById`
- Implement `testFindEventAndExceptions` and `testFindEventAndExceptions_NotFound`
- Implement `testGetById_NotFound`
- Implement `testIterateEventAndExceptions` and `testIterateEventAndExceptions_NotFound`
- Add helper function `insertRecurring` to reduce code duplication
@rfc2822 rfc2822 linked an issue Nov 14, 2025 that may be closed by this pull request
@rfc2822 rfc2822 added the refactoring Quality improvement of existing functions label Nov 14, 2025
@rfc2822 rfc2822 requested a review from Copilot November 14, 2025 10:15
Copilot finished reviewing on behalf of rfc2822 November 14, 2025 10:17
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds comprehensive test coverage for several public methods in AndroidRecurringCalendar and improves documentation for exception handling requirements.

  • Adds test coverage for findEventAndExceptions, getById, and iterateEventAndExceptions methods
  • Refactors existing test to use a reusable helper method
  • Clarifies documentation about sync ID requirements for exception events

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
lib/src/main/kotlin/at/bitfire/synctools/storage/calendar/AndroidRecurringCalendar.kt Enhanced documentation for addEventAndExceptions to clarify the requirement for setting Events._SYNC_ID and Events.ORIGINAL_SYNC_ID when working with exception events
lib/src/androidTest/kotlin/at/bitfire/synctools/storage/calendar/AndroidRecurringCalendarTest.kt Added tests for findEventAndExceptions, getById, and iterateEventAndExceptions methods, including both success and not-found scenarios; refactored test code to use a reusable insertRecurring helper method

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@rfc2822 rfc2822 marked this pull request as ready for review November 14, 2025 10:17
@rfc2822 rfc2822 requested a review from a team as a code owner November 14, 2025 10:17
Copy link
Member

@ArnyminerZ ArnyminerZ left a comment

Choose a reason for hiding this comment

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

Looks good

@rfc2822 rfc2822 merged commit 5ddf446 into main Nov 17, 2025
13 checks passed
@rfc2822 rfc2822 deleted the 130-add-tests-for-androidrecurringcalendar branch November 17, 2025 08:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactoring Quality improvement of existing functions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add tests for AndroidRecurringCalendar

2 participants