Skip to content

Commit

Permalink
Added test for demonstrating leap year behaviour (implicit BYMONTHDAY…
Browse files Browse the repository at this point in the history
… rules applied after processing this rule)
  • Loading branch information
benfortuna committed Dec 12, 2018
1 parent 41e3129 commit 45ff076
Showing 1 changed file with 5 additions and 3 deletions.
Expand Up @@ -2,6 +2,7 @@ package net.fortuna.ical4j.transform.recurrence

import net.fortuna.ical4j.model.Date
import net.fortuna.ical4j.model.DateList
import net.fortuna.ical4j.model.DateTime
import net.fortuna.ical4j.model.NumberList
import net.fortuna.ical4j.model.parameter.Value
import spock.lang.Specification
Expand All @@ -13,14 +14,15 @@ class ByMonthRuleTest extends Specification {
ByMonthRule rule = [new NumberList(byMonthPart), Optional.empty()]

and: 'a list of dates'
DateList dateList = [Value.DATE]
DateList dateList = [valueType]
dateList.addAll(dates)

expect: 'the rule transforms the dates correctly'
rule.transform(dateList) == expectedResult

where:
byMonthPart | dates | expectedResult
'1,2' | [new Date('20150103')] | [new Date('20150103'), new Date('20150203')]
byMonthPart | dates | valueType | expectedResult
'1,2' | [new Date('20150103')] | Value.DATE | [new Date('20150103'), new Date('20150203')]
'2' | [new DateTime("20200229T000000")] | Value.DATE_TIME| [new DateTime("20210228T000000")]
}
}

0 comments on commit 45ff076

Please sign in to comment.