Browse Source

Five attributes added to CensusEntry domain

Andrew Grant 7 months ago
parent
commit
cf49548136

+ 48 - 0
src/main/java/scot/carricksoftware/grants/domains/census/CensusEntry.java

@@ -75,6 +75,22 @@ public class CensusEntry extends BaseEntity {
     @Column(name = "`notes`")
     private String notes;
 
+    @SuppressWarnings("JpaDataSourceORMInspection")
+    @Column(name = "`children_who_have_died`")
+    private String childrenWhoHaveDied;
+
+    @SuppressWarnings("JpaDataSourceORMInspection")
+    @Column(name = "`children_still_alive`")
+    private String childrenStillAlive;
+
+    @SuppressWarnings("JpaDataSourceORMInspection")
+    @Column(name = "`children_born_alive`")
+    private String childrenBornAlive;
+
+    @SuppressWarnings("JpaDataSourceORMInspection")
+    @Column(name = "`years_Completed_Marriage`")
+    private String yearsCompletedMarriage;
+
     public Person getPerson() {
         return person;
     }
@@ -190,4 +206,36 @@ public class CensusEntry extends BaseEntity {
     public void setNotes(String notes) {
         this.notes = notes;
     }
+
+    public String getChildrenWhoHaveDied() {
+        return childrenWhoHaveDied;
+    }
+
+    public void setChildrenWhoHaveDied(String childrenWhoHaveDied) {
+        this.childrenWhoHaveDied = childrenWhoHaveDied;
+    }
+
+    public String getChildrenStillAlive() {
+        return childrenStillAlive;
+    }
+
+    public void setChildrenStillAlive(String childrenStillAlive) {
+        this.childrenStillAlive = childrenStillAlive;
+    }
+
+    public String getChildrenBornAlive() {
+        return childrenBornAlive;
+    }
+
+    public void setChildrenBornAlive(String childrenBornAlive) {
+        this.childrenBornAlive = childrenBornAlive;
+    }
+
+    public String getYearsCompletedMarriage() {
+        return yearsCompletedMarriage;
+    }
+
+    public void setYearsCompletedMarriage(String yearsCompletedMarriage) {
+        this.yearsCompletedMarriage = yearsCompletedMarriage;
+    }
 }

+ 1 - 49
src/test/java/scot/carricksoftware/grants/domains/census/CensusEntryTest.java → src/test/java/scot/carricksoftware/grants/domains/census/CensusEntryPartOneTest.java

@@ -19,7 +19,7 @@ import static scot.carricksoftware.grants.GenerateCertificateRandomValues.GetRan
 import static scot.carricksoftware.grants.GenerateRandomCensusValues.GetRandomCensus;
 
 @ExtendWith(MockitoExtension.class)
-class CensusEntryTest {
+class CensusEntryPartOneTest {
 
     private CensusEntry entry;
 
@@ -101,53 +101,5 @@ class CensusEntryTest {
         assertEquals(whereBorn, entry.getWhereBorn());
     }
 
-    @Test
-    void getBirthDayTest() {
-        assertNull(entry.getBirthDay());
-    }
-
-    @Test
-    void setBirthDayTest() {
-        String birthDay = GetRandomString();
-        entry.setBirthDay(birthDay);
-        assertEquals(birthDay, entry.getBirthDay());
-    }
-
-    @Test
-    void getBirthYearTest() {
-        assertNull(entry.getBirthYear());
-    }
-
-    @Test
-    void setBirthYearTest() {
-        String birthYear = GetRandomString();
-        entry.setBirthYear(birthYear);
-        assertEquals(birthYear, entry.getBirthYear());
-    }
-
-    @Test
-    void getPersonalOccupationTest() {
-        assertNull(entry.getPersonalOccupation());
-    }
-
-    @Test
-    void setPersonalOccupationTest() {
-        String occupation = GetRandomString();
-        entry.setPersonalOccupation(occupation);
-        assertEquals(occupation, entry.getPersonalOccupation());
-    }
-
-    @Test
-    void getNotesTest() {
-        assertNull(entry.getNotes());
-    }
-
-    @Test
-    void setNotesTest() {
-        String notes = GetRandomString();
-        entry.setNotes(notes);
-        assertEquals(notes, entry.getNotes());
-    }
-
 
 }

+ 76 - 0
src/test/java/scot/carricksoftware/grants/domains/census/CensusEntryPartThreeTest.java

@@ -0,0 +1,76 @@
+/*
+ * Copyright (c) Andrew Grant of Carrick Software 20/03/2025, 11:01. All rights reserved.
+ *
+ */
+
+package scot.carricksoftware.grants.domains.census;
+
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.ExtendWith;
+import org.mockito.junit.jupiter.MockitoExtension;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static scot.carricksoftware.grants.GenerateCertificateRandomValues.GetRandomString;
+
+@ExtendWith(MockitoExtension.class)
+class CensusEntryPartThreeTest {
+
+    private CensusEntry entry;
+
+
+    @BeforeEach
+    void setUp() {
+        entry = new CensusEntry();
+    }
+
+    @Test
+    public void getChildrenWhoHaveDiedTest() {
+        assertNull(entry.getChildrenWhoHaveDied());
+    }
+
+    @Test
+    public void setChildrenWhoHaveDiedTest() {
+        String string = GetRandomString();
+        entry.setChildrenWhoHaveDied(string);
+        assertEquals(string, entry.getChildrenWhoHaveDied());
+    }
+
+    @Test
+    public void getChildrenStillAliveTest() {
+        assertNull(entry.getChildrenStillAlive());
+    }
+
+    @Test
+    public void setChildrenStillAliveTest() {
+        String string = GetRandomString();
+        entry.setChildrenStillAlive(string);
+        assertEquals(string, entry.getChildrenStillAlive());
+    }
+
+    @Test
+    public void getChildrenBornAliveTest() {
+        assertNull(entry.getChildrenBornAlive());
+    }
+
+    @Test
+    public void setChildrenBornAliveTest() {
+        String string = GetRandomString();
+        entry.setChildrenBornAlive(string);
+        assertEquals(string, entry.getChildrenBornAlive());
+    }
+
+    @Test
+    public void getYearsCompletedMarriageTest() {
+        assertNull(entry.getYearsCompletedMarriage());
+    }
+
+    @Test
+    public void setYearsCompletedMarriageTest() {
+        String string = GetRandomString();
+        entry.setYearsCompletedMarriage(string);
+        assertEquals(string, entry.getYearsCompletedMarriage());
+    }
+
+}

+ 78 - 0
src/test/java/scot/carricksoftware/grants/domains/census/CensusEntryPartTwoTest.java

@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) Andrew Grant of Carrick Software 20/03/2025, 11:01. All rights reserved.
+ *
+ */
+
+package scot.carricksoftware.grants.domains.census;
+
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.ExtendWith;
+import org.mockito.junit.jupiter.MockitoExtension;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static scot.carricksoftware.grants.GenerateCertificateRandomValues.GetRandomString;
+
+@ExtendWith(MockitoExtension.class)
+class CensusEntryPartTwoTest {
+
+    private CensusEntry entry;
+
+
+    @BeforeEach
+    void setUp() {
+        entry = new CensusEntry();
+    }
+
+
+    @Test
+    void getBirthDayTest() {
+        assertNull(entry.getBirthDay());
+    }
+
+    @Test
+    void setBirthDayTest() {
+        String birthDay = GetRandomString();
+        entry.setBirthDay(birthDay);
+        assertEquals(birthDay, entry.getBirthDay());
+    }
+
+    @Test
+    void getBirthYearTest() {
+        assertNull(entry.getBirthYear());
+    }
+
+    @Test
+    void setBirthYearTest() {
+        String birthYear = GetRandomString();
+        entry.setBirthYear(birthYear);
+        assertEquals(birthYear, entry.getBirthYear());
+    }
+
+    @Test
+    void getPersonalOccupationTest() {
+        assertNull(entry.getPersonalOccupation());
+    }
+
+    @Test
+    void setPersonalOccupationTest() {
+        String occupation = GetRandomString();
+        entry.setPersonalOccupation(occupation);
+        assertEquals(occupation, entry.getPersonalOccupation());
+    }
+
+    @Test
+    void getNotesTest() {
+        assertNull(entry.getNotes());
+    }
+
+    @Test
+    void setNotesTest() {
+        String notes = GetRandomString();
+        entry.setNotes(notes);
+        assertEquals(notes, entry.getNotes());
+    }
+
+
+}