Procházet zdrojové kódy

person date of birth in domain

Andrew Grant před 7 měsíci
rodič
revize
11155d4746

+ 18 - 0
src/main/java/scot/carricksoftware/grants/domains/people/Person.java

@@ -13,6 +13,8 @@ public class Person extends BaseEntity {
 
     String firstName;
     String lastName;
+    String recordedYearOfBirth;
+    String certifiedYearOfBirth;
 
     public String getFirstName() {
         return firstName;
@@ -34,4 +36,20 @@ public class Person extends BaseEntity {
     public String toString() {
         return lastName + ", " + firstName;
     }
+
+    public String getRecordedYearOfBirth() {
+        return recordedYearOfBirth;
+    }
+
+    public void setRecordedYearOfBirth(String recordedYearOfBirth) {
+        this.recordedYearOfBirth = recordedYearOfBirth;
+    }
+
+    public String getCertifiedYearOfBirth() {
+        return certifiedYearOfBirth;
+    }
+
+    public void setCertifiedYearOfBirth(String certifiedYearOfBirth) {
+        this.certifiedYearOfBirth = certifiedYearOfBirth;
+    }
 }

+ 23 - 0
src/test/java/scot/carricksoftware/grants/domains/people/PersonTest.java

@@ -55,6 +55,29 @@ class PersonTest {
 
         assertEquals(lastName + ", " + firstName, person.toString());
     }
+    
+    @Test
+    void getRecodedYearOfBirthTest() {
+        assertNull(person.getRecordedYearOfBirth());
+    }
+
+    @Test
+    void setRecordedYearOfBirthTest() {
+        String string = GetRandomString();
+        person.setRecordedYearOfBirth(string);
+        assertEquals(string, person.getRecordedYearOfBirth());
+    }
 
+    @Test
+    void getCertifiedYearOfBirthTest() {
+        assertNull(person.getCertifiedYearOfBirth());
+    }
+
+    @Test
+    void setCertifiedYearOfBirthTest() {
+        String string = GetRandomString();
+        person.setCertifiedYearOfBirth(string);
+        assertEquals(string, person.getCertifiedYearOfBirth());
+    }
 
 }