Skip to content

Commit

Permalink
Added valid date test
Browse files Browse the repository at this point in the history
  • Loading branch information
benfortuna committed May 18, 2018
1 parent b2beff8 commit 30ca4ef
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/test/groovy/net/fortuna/ical4j/model/DateTimeSpec.groovy
Expand Up @@ -151,7 +151,20 @@ class DateTimeSpec extends Specification {
dateTimeString | timezone
'20110327T010000' | tzRegistry.getTimeZone('Europe/London')
}


@Unroll
def 'verify parse success for valid dates: #dateTimeString'() {
when:
def dt = new DateTime(dateTimeString, timezone)

then:
dt as String == dateTimeString

where:
dateTimeString | timezone
'20180319T061500' | tzRegistry.getTimeZone('Europe/Dublin')
}

def 'test conversion of UTC date-time to local time'() {
setup: 'Override default timezone for test consistency'
def originalTimezone = TimeZone.default
Expand Down

0 comments on commit 30ca4ef

Please sign in to comment.