From 7ae7650c2d4755f5f399b90dfbe09a70cbacc5c1 Mon Sep 17 00:00:00 2001 From: Maxim Volkov Date: Thu, 17 Feb 2022 02:39:46 +0100 Subject: [PATCH] Cleanup: Birthday class --- .../de/hs_fulda/ciip/projjpn/Birthdate.java | 30 ++++--------------- .../hs_fulda/ciip/projjpn/BirthdateTest.java | 4 +-- 2 files changed, 8 insertions(+), 26 deletions(-) diff --git a/projjpn/src/main/java/de/hs_fulda/ciip/projjpn/Birthdate.java b/projjpn/src/main/java/de/hs_fulda/ciip/projjpn/Birthdate.java index ad05fb7..14062d7 100644 --- a/projjpn/src/main/java/de/hs_fulda/ciip/projjpn/Birthdate.java +++ b/projjpn/src/main/java/de/hs_fulda/ciip/projjpn/Birthdate.java @@ -11,35 +11,17 @@ public class Birthdate { 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 */ public String toString() { return day + "." + month + "." + year; } + + public void changeBirthdate(int d, int m, int y) { + day = d; + month = m; + year = y; + } } diff --git a/projjpn/src/test/java/de/hs_fulda/ciip/projjpn/BirthdateTest.java b/projjpn/src/test/java/de/hs_fulda/ciip/projjpn/BirthdateTest.java index 6461784..312a870 100644 --- a/projjpn/src/test/java/de/hs_fulda/ciip/projjpn/BirthdateTest.java +++ b/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()}. */ - public final void testToString() { + public void testToString() { // Given Birthdate b = new Birthdate(1, 1, 2000); @@ -17,5 +17,5 @@ public class BirthdateTest extends TestCase { // Then assertEquals(expectedDate, b.toString()); - } + } }