public Employment(String organization, Date startDate, Date endDate) { this.organization = organization; this.startDate = new Date(startDate.getMonth(), startDate.getDay(), startDate.getYear()); this.endDate = null; if (endDate != null) { this.endDate = new Date(endDate.getMonth(), endDate.getDay(), endDate.getYear()); } }
@Test public void testValidDay29_2_1996() throws DateException { validDate = new Date(29, 2, 1996); assertEquals(new Integer(29), validDate.getDay()); }
@Test public void testValidDay28_2_1995() throws DateException { validDate = new Date(28, 2, 1995); assertEquals(new Integer(28), validDate.getDay()); }
@Test public void testDayValid() throws DateException { assertEquals(new Integer(4), validDate.getDay()); }
@Test public void testMonthValid() throws DateException { assertEquals(new Integer(8), validDate.getMonth()); }
/** * Valid entries * * @throws DateException */ @Test public void testYearValid() throws DateException { assertEquals(new Integer(1995), validDate.getYear()); }