Browse Source

Cleanup: Birthday class

feature-pr/user
Maxim Volkov 3 years ago
parent
commit
7ae7650c2d
  1. 30
      projjpn/src/main/java/de/hs_fulda/ciip/projjpn/Birthdate.java
  2. 4
      projjpn/src/test/java/de/hs_fulda/ciip/projjpn/BirthdateTest.java

30
projjpn/src/main/java/de/hs_fulda/ciip/projjpn/Birthdate.java

@ -11,35 +11,17 @@ public class Birthdate {
year = y; year = y;
} }
public int getDay() {
return day;
}
public void setDay(int day) {
this.day = day;
}
public int getMonth() {
return month;
}
public void setMonth(int month) {
this.month = month;
}
public int getYear() {
return year;
}
public void setYear(int year) {
this.year = year;
}
/** /**
* @return Date Format TT.DD.YYYY * @return Date Format TT.DD.YYYY
*/ */
public String toString() { public String toString() {
return day + "." + month + "." + year; return day + "." + month + "." + year;
} }
public void changeBirthdate(int d, int m, int y) {
day = d;
month = m;
year = y;
}
} }

4
projjpn/src/test/java/de/hs_fulda/ciip/projjpn/BirthdateTest.java

@ -7,7 +7,7 @@ public class BirthdateTest extends TestCase {
/** /**
* Test method for {@link de.hs_fulda.ciip.projjpn.Birthdate#toString()}. * Test method for {@link de.hs_fulda.ciip.projjpn.Birthdate#toString()}.
*/ */
public final void testToString() {
public void testToString() {
// Given // Given
Birthdate b = new Birthdate(1, 1, 2000); Birthdate b = new Birthdate(1, 1, 2000);
@ -17,5 +17,5 @@ public class BirthdateTest extends TestCase {
// Then // Then
assertEquals(expectedDate, b.toString()); assertEquals(expectedDate, b.toString());
}
}
} }
Loading…
Cancel
Save