/*
* The ISO 8601 standard document uses April 12, 1985 as an example, so
* let's make sure we get it right.
*/
public void testApril_12_1985() {
Iso8601Date d = new Iso8601Date(DateConfiguration.YEAR_MONTH_DAY, 1985,
4, 12);
assertEquals(d.getCentury(), 19);
assertEquals(d.getYear(), 1985);
assertEquals(d.getMonth(), 4);
assertEquals(d.getDayOfMonth(), 12);
assertTrue(d.isDay());
assertFalse(d.isCentury());
assertFalse(d.isYear());
assertFalse(d.isMonth());
assertFalse(d.isWeek());
GregorianCalendar c = d.getCalendarForDay();
assertEquals(c.get(Calendar.YEAR), 1985);
assertEquals(c.get(Calendar.MONTH), 3);
assertEquals(c.get(Calendar.DAY_OF_MONTH), 12);
assertEquals(c.get(Calendar.DAY_OF_YEAR), 102);
assertEquals(d.getDayOfYear(), 102);
assertEquals(d.getWeekOfYear(), 15);
assertEquals(d.getDayOfWeek(), 5);
assertEquals(c.get(Calendar.WEEK_OF_YEAR), 15);
Iso8601Date d2 = new Iso8601Date(DateConfiguration.YEAR_DAY_OF_YEAR,
1985, 102);
assertEquals(d2.getCentury(), 19);
assertEquals(d2.getYear(), 1985);
assertEquals(d2.getMonth(), 4);
assertEquals(d2.getDayOfMonth(), 12);
assertEquals(d2.getDayOfYear(), 102);
assertTrue(d2.isDay());
assertFalse(d2.isCentury());
assertFalse(d2.isYear());
assertFalse(d2.isMonth());
assertFalse(d2.isWeek());
GregorianCalendar c2 = d2.getCalendarForDay();
assertEquals(c2.get(Calendar.YEAR), 1985);
assertEquals(c2.get(Calendar.MONTH), 3);
assertEquals(c2.get(Calendar.DAY_OF_MONTH), 12);
assertEquals(c2.get(Calendar.DAY_OF_YEAR), 102);
assertEquals(d2.getWeekOfYear(), 15);
assertEquals(d2.getDayOfWeek(), 5);
assertEquals(c2.get(Calendar.WEEK_OF_YEAR), 15);
Iso8601Date d3 = new Iso8601Date(DateConfiguration.YEAR_WEEK_DAY,
1985, 15, 5);
assertEquals(d3.getCentury(), 19);
assertEquals(d3.getYear(), 1985);
assertEquals(d3.getWeekOfYear(), 15);
assertEquals(d3.getDayOfWeek(), 5);
assertEquals(d3.getMonth(), 4);
assertEquals(d3.getDayOfMonth(), 12);
assertEquals(d3.getDayOfYear(), 102);
assertTrue(d3.isDay());
assertFalse(d3.isCentury());
assertFalse(d3.isYear());
assertFalse(d3.isMonth());
assertFalse(d3.isWeek());
assertEquals(d3.getMonth(), 4);
assertEquals(d3.getDayOfMonth(), 12);
GregorianCalendar c3 = d3.getCalendarForDay();
assertEquals(c3.get(Calendar.YEAR), 1985);
assertEquals(c3.get(Calendar.MONTH), 3);
assertEquals(c3.get(Calendar.DAY_OF_MONTH), 12);
assertEquals(c3.get(Calendar.DAY_OF_YEAR), 102);
assertEquals(c3.get(Calendar.WEEK_OF_YEAR), 15);