mirror of
https://github.com/AntennaPod/AntennaPod.git
synced 2024-12-25 16:23:54 +01:00
Updated DateUtilTest to include new date format test.
This commit is contained in:
parent
1e598156ae
commit
1796b5d739
@ -3,6 +3,7 @@ package de.danoeh.antennapod.core.util;
|
||||
|
||||
import android.test.AndroidTestCase;
|
||||
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.GregorianCalendar;
|
||||
import java.util.TimeZone;
|
||||
@ -156,4 +157,12 @@ public class DateUtilsTest extends AndroidTestCase {
|
||||
Date actual = DateUtils.parse("Mon, 8 Sept 2014 00:00:00 GMT"); // should be Sep
|
||||
assertEquals(expected, actual);
|
||||
}
|
||||
|
||||
public void testParseDateWithTwoTimezones() {
|
||||
final GregorianCalendar exp1 = new GregorianCalendar(2015, Calendar.MARCH, 1, 1, 0, 0);
|
||||
exp1.setTimeZone(TimeZone.getTimeZone("GMT-4"));
|
||||
final Date expected = new Date(exp1.getTimeInMillis());
|
||||
final Date actual = DateUtils.parse("Sun 01 Mar 2015 01:00:00 GMT-0400 (EDT)");
|
||||
assertEquals(expected, actual);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user