|
@ -4,9 +4,6 @@ import junit.framework.TestCase; |
|
|
|
|
|
|
|
|
public class BirthdateTest extends TestCase { |
|
|
public class BirthdateTest extends TestCase { |
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* Test method for {@link de.hs_fulda.ciip.projjpn.Birthdate#toString()}. |
|
|
|
|
|
*/ |
|
|
|
|
|
public void testToString() { |
|
|
public void testToString() { |
|
|
|
|
|
|
|
|
// Given |
|
|
// Given |
|
@ -18,4 +15,23 @@ public class BirthdateTest extends TestCase { |
|
|
// Then |
|
|
// Then |
|
|
assertEquals(expectedDate, b.toString()); |
|
|
assertEquals(expectedDate, b.toString()); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void test_changeBirthdate() { |
|
|
|
|
|
// Given |
|
|
|
|
|
Birthdate b = new Birthdate(1, 1, 2000); |
|
|
|
|
|
|
|
|
|
|
|
// Change Birthdate |
|
|
|
|
|
b.changeBirthdate(2, 3, 2001); |
|
|
|
|
|
|
|
|
|
|
|
// When |
|
|
|
|
|
int expectedDay = 2; |
|
|
|
|
|
int expectedMonth = 3; |
|
|
|
|
|
int expectedYear = 2001; |
|
|
|
|
|
|
|
|
|
|
|
// Then |
|
|
|
|
|
assertEquals(2, b.getDay()); |
|
|
|
|
|
assertEquals(3, b.getMonth()); |
|
|
|
|
|
assertEquals(2001, b.getYear()); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |