Skip to content

Commit

Permalink
Test BYDAY with UNTIL
Browse files Browse the repository at this point in the history
  • Loading branch information
adamjhamer committed Jan 6, 2022
1 parent 72e2d65 commit 5e5f3e2
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public void testRecurrenceExpanderTimezone() throws Exception {
public void testRecurrenceExpanderLongEvent() throws Exception {
RecurrenceExpander expander = new RecurrenceExpander();
Calendar calendar = getCalendar("tz_recurring3.ics");

Date[] range = expander.calculateRecurrenceRange(calendar);

Assert.assertEquals("20070101T100000", range[0].toString());
Expand All @@ -124,8 +124,17 @@ public void testRecurrenceExpanderSingleOccurrence() throws Exception {

Assert.assertEquals(1, instances.size());
}



public void testRecurrenceExpanderRuleWithDays() throws Exception {
RecurrenceExpander expander = new RecurrenceExpander();
Calendar calendar = getCalendar("floating_recurring5.ics");

Date[] range = expander.calculateRecurrenceRange(calendar);

Assert.assertEquals("20220104T100000", range[0].toString());
Assert.assertEquals("20220121T101000", range[1].toString());
}

public void testIsOccurrence() throws Exception {
RecurrenceExpander expander = new RecurrenceExpander();
Calendar calendar = getCalendar("floating_recurring3.ics");
Expand Down
13 changes: 13 additions & 0 deletions core/src/test/resources/testdata/expander/floating_recurring5.ics
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
BEGIN:VCALENDAR
PRODID:-//Open Source Applications Foundation//NONSGML Chandler Server//EN
VERSION:2.0
CALSCALE:GREGORIAN
BEGIN:VEVENT
DTSTAMP:20220104T221843Z
UID:5a28c953-11d4-48d2-b325-30d8ac9b8b14
DTSTART:20220104T100000
DTEND:20220104T101000
SUMMARY:test days of week go all the way to until
RRULE:FREQ=WEEKLY;UNTIL=20220123T100000;COUNT=-1;BYDAY=MO,WE,FR
END:VEVENT
END:VCALENDAR

0 comments on commit 5e5f3e2

Please sign in to comment.