Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3812c9a
commit 35ad1ab
Showing
1 changed file
with
27 additions
and
0 deletions.
There are no files selected for viewing
27 changes: 27 additions & 0 deletions
27
src/test/groovy/net/fortuna/ical4j/filter/DateInRangeRuleTest.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package net.fortuna.ical4j.filter | ||
|
||
import net.fortuna.ical4j.model.DateRange | ||
import spock.lang.Shared | ||
import spock.lang.Specification | ||
|
||
class DateInRangeRuleTest extends Specification { | ||
|
||
@Shared def rangeFrom = Calendar.instance | ||
@Shared def rangeTo = Calendar.instance | ||
|
||
def setupSpec() { | ||
rangeTo.add(Calendar.DAY_OF_MONTH, 7) | ||
} | ||
|
||
def 'assert rule match'() { | ||
given: 'a date range rule' | ||
DateInRangeRule rule = [range, DateRange.INCLUSIVE_START | DateRange.INCLUSIVE_END] | ||
|
||
expect: | ||
rule.test(date) == test | ||
|
||
where: | ||
range | date | test | ||
new DateRange(rangeFrom.getTime(), rangeTo.getTime()) | new Date() | true | ||
} | ||
} |