浏览代码

Added all domains and tests

Andrew Grant 3 月之前
父节点
当前提交
afb6ea5710
共有 29 个文件被更改,包括 1073 次插入19 次删除
  1. 19 0
      src/main/java/scot/carricksoftware/grantswriter/enums/certificates/CertificateType.java
  2. 62 0
      src/test/java/scot/carricksoftware/grantswriter/GenerateCensusEntryRandomEnums.java
  3. 38 0
      src/test/java/scot/carricksoftware/grantswriter/GenerateCensusRandomEnums.java
  4. 30 0
      src/test/java/scot/carricksoftware/grantswriter/GenerateCertificateRandomValues.java
  5. 38 0
      src/test/java/scot/carricksoftware/grantswriter/GenerateGeneralRandomEnums.java
  6. 34 0
      src/test/java/scot/carricksoftware/grantswriter/GenerateRandomCensusValues.java
  7. 23 0
      src/test/java/scot/carricksoftware/grantswriter/GenerateRandomDateValues.java
  8. 45 0
      src/test/java/scot/carricksoftware/grantswriter/GenerateRandomImageValues.java
  9. 0 5
      src/test/java/scot/carricksoftware/grantswriter/GenerateRandomNumberValues.java
  10. 4 4
      src/test/java/scot/carricksoftware/grantswriter/GenerateRandomPeopleValues.java
  11. 40 0
      src/test/java/scot/carricksoftware/grantswriter/GenerateRandomPlaceValues.java
  12. 41 0
      src/test/java/scot/carricksoftware/grantswriter/GenerateRandomTextValues.java
  13. 1 1
      src/test/java/scot/carricksoftware/grantswriter/controllers/FilesControllerTest.java
  14. 1 1
      src/test/java/scot/carricksoftware/grantswriter/controllers/TexControllerTest.java
  15. 1 1
      src/test/java/scot/carricksoftware/grantswriter/data/TimelineDataGetterAndSetterTest.java
  16. 111 0
      src/test/java/scot/carricksoftware/grantswriter/domains/census/CensusEntryEnumTest.java
  17. 105 0
      src/test/java/scot/carricksoftware/grantswriter/domains/census/CensusEntryPartOneTest.java
  18. 90 0
      src/test/java/scot/carricksoftware/grantswriter/domains/census/CensusEntryPartThreeTest.java
  19. 78 0
      src/test/java/scot/carricksoftware/grantswriter/domains/census/CensusEntryPartTwoTest.java
  20. 54 0
      src/test/java/scot/carricksoftware/grantswriter/domains/census/CensusEnumTest.java
  21. 92 0
      src/test/java/scot/carricksoftware/grantswriter/domains/census/CensusPartOneTest.java
  22. 102 0
      src/test/java/scot/carricksoftware/grantswriter/domains/census/CensusPartTwoTest.java
  23. 53 0
      src/test/java/scot/carricksoftware/grantswriter/domains/census/CensusRoomsTest.java
  24. 1 1
      src/test/java/scot/carricksoftware/grantswriter/domains/people/PersonTest.java
  25. 5 2
      src/test/java/scot/carricksoftware/grantswriter/files/WriterFilesTest.java
  26. 2 1
      src/test/java/scot/carricksoftware/grantswriter/writer/FileWriterTest.java
  27. 1 1
      src/test/java/scot/carricksoftware/grantswriter/writer/TexWriterTest.java
  28. 1 1
      src/test/java/scot/carricksoftware/grantswriter/writer/latex/LatexPartHeaderTest.java
  29. 1 1
      src/test/java/scot/carricksoftware/grantswriter/writer/latex/LatexSectionHeaderTest.java

+ 19 - 0
src/main/java/scot/carricksoftware/grantswriter/enums/certificates/CertificateType.java

@@ -0,0 +1,19 @@
+/*
+ * Copyright (c) 2025.  Andrew Grant Carrick Software. All rights reserved
+ *
+ */
+
+package scot.carricksoftware.grantswriter.enums.certificates;
+
+public enum CertificateType {
+
+    @SuppressWarnings("unused") EXTRACT("Extract");
+
+    @SuppressWarnings("unused")
+    public final String label;
+
+    @SuppressWarnings({"unused", "SameParameterValue"})
+    CertificateType(String label) {
+        this.label = label;
+    }
+}

+ 62 - 0
src/test/java/scot/carricksoftware/grantswriter/GenerateCensusEntryRandomEnums.java

@@ -0,0 +1,62 @@
+/*
+ * Copyright (c)  04 Feb 2025, Andrew Grant of Carrick Software .
+ * All rights reserved.
+ */
+
+package scot.carricksoftware.grantswriter;
+
+import org.springframework.stereotype.Component;
+import scot.carricksoftware.grantswriter.enums.censusentry.CensusEntryCondition;
+import scot.carricksoftware.grantswriter.enums.censusentry.CensusEntryGaelic;
+import scot.carricksoftware.grantswriter.enums.censusentry.CensusEntryRelationship;
+import scot.carricksoftware.grantswriter.enums.censusentry.CensusEntryWorker;
+import scot.carricksoftware.grantswriter.enums.general.Sex;
+
+
+import java.util.Random;
+
+@SuppressWarnings("unused")
+@Component
+public class GenerateCensusEntryRandomEnums {
+
+    public static CensusEntryCondition GetRandomCensusEntryCondition() {
+
+        CensusEntryCondition[] conditions = CensusEntryCondition.values();
+
+        Random random = new Random();
+        int randomInt = random.nextInt(0, conditions.length);
+        return conditions[randomInt];
+    }
+
+    public static CensusEntryGaelic GetRandomCensusEntryGaelic() {
+        CensusEntryGaelic[] gaelicArray = CensusEntryGaelic.values();
+
+        Random random = new Random();
+        int randomInt = random.nextInt(0, gaelicArray.length);
+        return gaelicArray[randomInt];
+    }
+
+    public static CensusEntryRelationship GetRandomCensusEntryRelationship() {
+        CensusEntryRelationship[] relationships = CensusEntryRelationship.values();
+
+        Random random = new Random();
+        int randomInt = random.nextInt(0, relationships.length);
+        return relationships[randomInt];
+    }
+
+    public static CensusEntryWorker GetRandomCensusEntryWorker() {
+        CensusEntryWorker[] workers = CensusEntryWorker.values();
+
+        Random random = new Random();
+        int randomInt = random.nextInt(0, workers.length);
+        return workers[randomInt];
+    }
+
+    public static Sex GetRandomCensusEntrySex() {
+        Sex[] sex = Sex.values();
+
+        Random random = new Random();
+        int randomInt = random.nextInt(0, sex.length);
+        return sex[randomInt];
+    }
+}

+ 38 - 0
src/test/java/scot/carricksoftware/grantswriter/GenerateCensusRandomEnums.java

@@ -0,0 +1,38 @@
+/*
+ * Copyright (c) 2025.  Andrew Grant Carrick Software. All rights reserved
+ *
+ */
+
+package scot.carricksoftware.grantswriter;
+
+import org.springframework.stereotype.Component;
+import scot.carricksoftware.grantswriter.enums.census.CensusBoundaryType;
+import scot.carricksoftware.grantswriter.enums.census.CensusDate;
+
+
+import java.util.Random;
+
+@SuppressWarnings("unused")
+@Component
+public class GenerateCensusRandomEnums {
+
+    public static CensusBoundaryType GetRandomCensusBoundaryType() {
+
+        CensusBoundaryType[] boundaryTypes = CensusBoundaryType.values();
+
+        Random random = new Random();
+        int randomInt = random.nextInt(0, boundaryTypes.length);
+        return boundaryTypes[randomInt];
+    }
+
+    public static CensusDate GetRandomCensusDate() {
+
+        CensusDate[] dates = CensusDate.values();
+
+        Random random = new Random();
+        int randomInt = random.nextInt(0, dates.length);
+        return dates[randomInt];
+    }
+
+
+}

+ 30 - 0
src/test/java/scot/carricksoftware/grantswriter/GenerateCertificateRandomValues.java

@@ -0,0 +1,30 @@
+/*
+ * Copyright (c)  04 Feb 2025, Andrew Grant of Carrick Software .
+ * All rights reserved.
+ */
+
+package scot.carricksoftware.grantswriter;
+
+
+
+import java.util.Random;
+
+
+
+public class GenerateCertificateRandomValues {
+
+    private static final Random rand = new Random();
+    @SuppressWarnings("SpellCheckingInspection")
+    private static final String[] names = {"Ryland", "Oscar", "Martha", "Brynn"
+            , "Euan", "Jack", "Ramsay", "Ally"};
+
+
+    public static String GetRandomString() {
+        int random = rand.nextInt(names.length);
+        return names[random];
+    }
+
+
+
+
+}

+ 38 - 0
src/test/java/scot/carricksoftware/grantswriter/GenerateGeneralRandomEnums.java

@@ -0,0 +1,38 @@
+/*
+ * Copyright (c) 2025.  Andrew Grant Carrick Software. All rights reserved
+ *
+ */
+
+package scot.carricksoftware.grantswriter;
+
+import org.springframework.stereotype.Component;
+import scot.carricksoftware.grantswriter.enums.certificates.CertificateType;
+import scot.carricksoftware.grantswriter.enums.general.YesNo;
+
+
+import java.util.Random;
+
+@SuppressWarnings("unused")
+@Component
+public class GenerateGeneralRandomEnums {
+
+    public static YesNo GetRandomGeneralYesNo() {
+
+        YesNo[] yesNoArray = YesNo.values();
+
+        Random random = new Random();
+        int randomInt = random.nextInt(0, yesNoArray.length);
+        return yesNoArray[randomInt];
+    }
+
+    public static CertificateType GetRandomCertificateType() {
+
+        CertificateType[] certificateTypes = CertificateType.values();
+
+        Random random = new Random();
+        int randomInt = random.nextInt(0, certificateTypes.length);
+        return certificateTypes[randomInt];
+    }
+
+
+}

+ 34 - 0
src/test/java/scot/carricksoftware/grantswriter/GenerateRandomCensusValues.java

@@ -0,0 +1,34 @@
+/*
+ * Copyright (c)  04 Feb 2025, Andrew Grant of Carrick Software .
+ * All rights reserved.
+ */
+
+package scot.carricksoftware.grantswriter;
+
+import scot.carricksoftware.grantswriter.domains.census.Census;
+import scot.carricksoftware.grantswriter.domains.census.CensusEntry;
+
+import static scot.carricksoftware.grantswriter.GenerateCertificateRandomValues.GetRandomString;
+import static scot.carricksoftware.grantswriter.GenerateRandomNumberValues.GetRandomLong;
+
+
+@SuppressWarnings("unused")
+public class GenerateRandomCensusValues {
+
+    @SuppressWarnings("unused")
+    public static Census GetRandomCensus() {
+        Census census = new Census();
+        census.setId(GetRandomLong());
+        return census;
+    }
+
+
+    public static CensusEntry GetRandomCensusEntry() {
+        CensusEntry censusEntry = new CensusEntry();
+        censusEntry.setId(GetRandomLong());
+        censusEntry.setName(GetRandomString());
+        return censusEntry;
+    }
+
+
+}

+ 23 - 0
src/test/java/scot/carricksoftware/grantswriter/GenerateRandomDateValues.java

@@ -0,0 +1,23 @@
+/*
+ * Copyright (c)  04 Feb 2025, Andrew Grant of Carrick Software .
+ * All rights reserved.
+ */
+
+package scot.carricksoftware.grantswriter;
+
+import org.springframework.stereotype.Component;
+
+import java.sql.Date;
+import java.time.LocalDate;
+
+@SuppressWarnings("unused")
+@Component
+public class GenerateRandomDateValues {
+
+    @SuppressWarnings("unused")
+    public static Date GetRandomDate() {
+        return Date.valueOf(LocalDate.now());
+    }
+
+
+}

+ 45 - 0
src/test/java/scot/carricksoftware/grantswriter/GenerateRandomImageValues.java

@@ -0,0 +1,45 @@
+/*
+ * Copyright (c)  04 Feb 2025, Andrew Grant of Carrick Software .
+ * All rights reserved.
+ */
+
+package scot.carricksoftware.grantswriter;
+
+import org.springframework.stereotype.Component;
+import scot.carricksoftware.grantswriter.domains.images.Image;
+import scot.carricksoftware.grantswriter.domains.images.PersonImage;
+import scot.carricksoftware.grantswriter.domains.images.PlaceImage;
+
+import static scot.carricksoftware.grantswriter.GenerateRandomNumberValues.GetRandomLong;
+
+
+@SuppressWarnings("unused")
+@Component
+public class GenerateRandomImageValues {
+
+    @SuppressWarnings("unused")
+    public static Image GetRandomImage() {
+        Image image = new Image();
+        image.setId(GetRandomLong());
+        return image;
+    }
+
+
+    @SuppressWarnings("unused")
+    public static PersonImage GetRandomPersonImage() {
+        PersonImage image = new PersonImage();
+        image.setId(GetRandomLong());
+        return image;
+    }
+
+
+    @SuppressWarnings("unused")
+    public static PlaceImage GetRandomPlaceImage() {
+        PlaceImage image = new PlaceImage();
+        image.setId(GetRandomLong());
+        return image;
+    }
+
+
+
+}

+ 0 - 5
src/test/java/scot/carricksoftware/grantswriter/GenerateRandomNumberValues.java

@@ -19,10 +19,5 @@ public class GenerateRandomNumberValues {
         return rand.nextLong();
     }
 
-    @SuppressWarnings("SameReturnValue")
-    public static String GetRandomString() {
-        return "Andrew";
-    }
-
 
 }

+ 4 - 4
src/test/java/scot/carricksoftware/grantswriter/GenerateRandomPeopleValues.java

@@ -5,15 +5,15 @@
 
 package scot.carricksoftware.grantswriter;
 
-import org.springframework.stereotype.Component;
+
 import scot.carricksoftware.grantswriter.domains.people.Person;
 
+import static scot.carricksoftware.grantswriter.GenerateCertificateRandomValues.GetRandomString;
 import static scot.carricksoftware.grantswriter.GenerateRandomNumberValues.GetRandomLong;
-import static scot.carricksoftware.grantswriter.GenerateRandomNumberValues.GetRandomString;
-
 
 @SuppressWarnings("unused")
-@Component
+
+
 public class GenerateRandomPeopleValues {
 
     @SuppressWarnings("unused")

+ 40 - 0
src/test/java/scot/carricksoftware/grantswriter/GenerateRandomPlaceValues.java

@@ -0,0 +1,40 @@
+/*
+ * Copyright (c)  04 Feb 2025, Andrew Grant of Carrick Software .
+ * All rights reserved.
+ */
+
+package scot.carricksoftware.grantswriter;
+
+
+import scot.carricksoftware.grantswriter.domains.places.Country;
+import scot.carricksoftware.grantswriter.domains.places.Place;
+import scot.carricksoftware.grantswriter.domains.places.Region;
+
+import static scot.carricksoftware.grantswriter.GenerateCertificateRandomValues.GetRandomString;
+
+@SuppressWarnings("unused")
+
+public class GenerateRandomPlaceValues {
+
+    @SuppressWarnings("unused")
+    public static Place GetRandomPlace() {
+        Place place = new Place();
+        place.setName(GetRandomString());
+        return place;
+    }
+
+    public static Country GetRandomCountry() {
+        Country country = new Country();
+        country.setName(GetRandomString());
+        return country;
+    }
+
+    public static Region GetRandomRegion() {
+        Region region = new Region();
+        region.setName(GetRandomString());
+        return region;
+    }
+
+
+
+}

+ 41 - 0
src/test/java/scot/carricksoftware/grantswriter/GenerateRandomTextValues.java

@@ -0,0 +1,41 @@
+/*
+ * Copyright (c)  04 Feb 2025, Andrew Grant of Carrick Software .
+ * All rights reserved.
+ */
+
+package scot.carricksoftware.grantswriter;
+
+
+import scot.carricksoftware.grantswriter.domains.text.DocumentText;
+import scot.carricksoftware.grantswriter.domains.text.PersonText;
+import scot.carricksoftware.grantswriter.domains.text.PlaceText;
+
+import static scot.carricksoftware.grantswriter.GenerateRandomNumberValues.GetRandomLong;
+import static scot.carricksoftware.grantswriter.GenerateRandomPeopleValues.GetRandomPerson;
+import static scot.carricksoftware.grantswriter.GenerateRandomPlaceValues.GetRandomPlace;
+
+@SuppressWarnings("unused")
+
+public class GenerateRandomTextValues {
+
+    public static DocumentText GetRandomDocumentText() {
+        DocumentText documentText = new DocumentText();
+        documentText.setId(GetRandomLong());
+        return documentText;
+    }
+
+    public static PersonText GetRandomPersonText() {
+        PersonText personText = new PersonText();
+        personText.setId(GetRandomLong());
+        personText.setPerson(GetRandomPerson());
+        return personText;
+    }
+
+    public static PlaceText GetRandomPlaceText() {
+        PlaceText placeText = new PlaceText();
+        placeText.setId(GetRandomLong());
+        placeText.setPlace(GetRandomPlace());
+        return placeText;
+    }
+
+}

+ 1 - 1
src/test/java/scot/carricksoftware/grantswriter/controllers/FilesControllerTest.java

@@ -17,7 +17,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.mockito.Mockito.times;
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
-import static scot.carricksoftware.grantswriter.GenerateRandomNumberValues.GetRandomString;
+import static scot.carricksoftware.grantswriter.GenerateCertificateRandomValues.GetRandomString;
 
 @ExtendWith(MockitoExtension.class)
 class FilesControllerTest {

+ 1 - 1
src/test/java/scot/carricksoftware/grantswriter/controllers/TexControllerTest.java

@@ -18,7 +18,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.mockito.Mockito.times;
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
-import static scot.carricksoftware.grantswriter.GenerateRandomNumberValues.GetRandomString;
+import static scot.carricksoftware.grantswriter.GenerateCertificateRandomValues.GetRandomString;
 
 
 @ExtendWith(MockitoExtension.class)

+ 1 - 1
src/test/java/scot/carricksoftware/grantswriter/data/TimelineDataGetterAndSetterTest.java

@@ -15,7 +15,7 @@ import java.util.TreeSet;
 
 import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.junit.jupiter.api.Assertions.assertNotNull;
-import static scot.carricksoftware.grantswriter.GenerateRandomNumberValues.GetRandomString;
+import static scot.carricksoftware.grantswriter.GenerateCertificateRandomValues.GetRandomString;
 
 class TimelineDataGetterAndSetterTest {
 

+ 111 - 0
src/test/java/scot/carricksoftware/grantswriter/domains/census/CensusEntryEnumTest.java

@@ -0,0 +1,111 @@
+/*
+ * Copyright (c) Andrew Grant of Carrick Software 20/03/2025, 11:01. All rights reserved.
+ *
+ */
+
+package scot.carricksoftware.grantswriter.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 scot.carricksoftware.grantswriter.enums.censusentry.CensusEntryCondition;
+import scot.carricksoftware.grantswriter.enums.censusentry.CensusEntryGaelic;
+import scot.carricksoftware.grantswriter.enums.censusentry.CensusEntryRelationship;
+import scot.carricksoftware.grantswriter.enums.censusentry.CensusEntryWorker;
+import scot.carricksoftware.grantswriter.enums.general.Sex;
+import scot.carricksoftware.grantswriter.enums.general.YesNo;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static scot.carricksoftware.grantswriter.GenerateCensusEntryRandomEnums.GetRandomCensusEntryCondition;
+import static scot.carricksoftware.grantswriter.GenerateCensusEntryRandomEnums.GetRandomCensusEntryGaelic;
+import static scot.carricksoftware.grantswriter.GenerateCensusEntryRandomEnums.GetRandomCensusEntryRelationship;
+import static scot.carricksoftware.grantswriter.GenerateCensusEntryRandomEnums.GetRandomCensusEntrySex;
+import static scot.carricksoftware.grantswriter.GenerateCensusEntryRandomEnums.GetRandomCensusEntryWorker;
+import static scot.carricksoftware.grantswriter.GenerateGeneralRandomEnums.GetRandomGeneralYesNo;
+
+@ExtendWith(MockitoExtension.class)
+class CensusEntryEnumTest {
+
+    private CensusEntry entry;
+
+    @BeforeEach
+    void setUp() {
+        entry = new CensusEntry();
+    }
+
+    @Test
+    void getRelationShipTest() {
+        assertNull(entry.getRelationship());
+    }
+
+    @Test
+    void setRelationshipTest() {
+        CensusEntryRelationship relationship = GetRandomCensusEntryRelationship();
+        entry.setRelationship(relationship);
+        assertEquals(relationship, entry.getRelationship());
+    }
+
+    @Test
+    void getConditionTest() {
+        assertNull(entry.getCondition());
+    }
+
+    @Test
+    void setConditionTest() {
+        CensusEntryCondition condition = GetRandomCensusEntryCondition();
+        entry.setCondition(condition);
+        assertEquals(condition, entry.getCondition());
+    }
+
+    @Test
+    void getGaelicTest() {
+        assertNull(entry.getCondition());
+    }
+
+    @Test
+    void setGaelicTest() {
+        CensusEntryGaelic gaelic = GetRandomCensusEntryGaelic();
+        entry.setGaelic(gaelic);
+        assertEquals(gaelic, entry.getGaelic());
+    }
+
+    @Test
+    void getWorkerTest() {
+        assertNull(entry.getCondition());
+    }
+
+    @Test
+    void setWorkerTest() {
+        CensusEntryWorker worker = GetRandomCensusEntryWorker();
+        entry.setWorker(worker);
+        assertEquals(worker, entry.getWorker());
+    }
+
+    @Test
+    void getSexTest() {
+        assertNull(entry.getSex());
+    }
+
+    @Test
+    void setSexTest() {
+        Sex sex = GetRandomCensusEntrySex();
+        entry.setSex(sex);
+        assertEquals(sex, entry.getSex());
+    }
+
+    @Test
+    void getWorkingAtHomeTest() {
+        assertNull(entry.getWorkingAtHome());
+    }
+
+    @Test
+    void setWorkingAtHomeTest() {
+        YesNo workingAtHome = GetRandomGeneralYesNo();
+        entry.setWorkingAtHome(workingAtHome);
+        assertEquals(workingAtHome, entry.getWorkingAtHome());
+    }
+
+
+}

+ 105 - 0
src/test/java/scot/carricksoftware/grantswriter/domains/census/CensusEntryPartOneTest.java

@@ -0,0 +1,105 @@
+/*
+ * Copyright (c) Andrew Grant of Carrick Software 20/03/2025, 11:01. All rights reserved.
+ *
+ */
+
+package scot.carricksoftware.grantswriter.domains.census;
+
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.ExtendWith;
+import org.mockito.Mock;
+import org.mockito.junit.jupiter.MockitoExtension;
+import scot.carricksoftware.grantswriter.domains.people.Person;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static org.mockito.Mockito.when;
+import static scot.carricksoftware.grantswriter.GenerateCertificateRandomValues.GetRandomString;
+import static scot.carricksoftware.grantswriter.GenerateRandomCensusValues.GetRandomCensus;
+
+@ExtendWith(MockitoExtension.class)
+class CensusEntryPartOneTest {
+
+    private CensusEntry entry;
+
+    @Mock
+    private Census censusMock;
+
+    @BeforeEach
+    void setUp() {
+        entry = new CensusEntry();
+    }
+
+    @Test
+    void getNameTest() {
+        assertNull(entry.getName());
+    }
+
+    @Test
+    void setNameTest() {
+        String name = GetRandomString();
+        entry.setName(name);
+        assertEquals(name, entry.getName());
+    }
+
+    @Test
+    void getCensusTest() {
+        assertNull(entry.getCensus());
+    }
+
+    @Test
+    void setCensusTest() {
+        Census census = GetRandomCensus();
+        entry.setCensus(census);
+        assertEquals(census, entry.getCensus());
+    }
+
+    @Test
+    void toStringTest() {
+        String string = GetRandomString();
+        entry.setCensus(censusMock);
+        when(censusMock.toString()).thenReturn(string);
+
+        entry.setName(GetRandomString());
+        assertEquals(string, entry.toString());
+    }
+
+    @Test
+    void getPersonTest() {
+        assertNull(entry.getPerson());
+    }
+
+    @Test
+    void setPersonTest() {
+        Person person = new Person();
+        entry.setPerson(person);
+        assertEquals(person, entry.getPerson());
+    }
+
+    @Test
+    void getAgeTest() {
+        assertNull(entry.getAge());
+    }
+
+    @Test
+    void setAgeTest() {
+        String age = GetRandomString();
+        entry.setAge(age);
+        assertEquals(age, entry.getAge());
+    }
+
+    @Test
+    void getWhereBornTest() {
+        assertNull(entry.getWhereBorn());
+    }
+
+    @Test
+    void setWhereBornTest() {
+        String whereBorn = GetRandomString();
+        entry.setWhereBorn(whereBorn);
+        assertEquals(whereBorn, entry.getWhereBorn());
+    }
+
+
+}

+ 90 - 0
src/test/java/scot/carricksoftware/grantswriter/domains/census/CensusEntryPartThreeTest.java

@@ -0,0 +1,90 @@
+/*
+ * Copyright (c) Andrew Grant of Carrick Software 20/03/2025, 11:01. All rights reserved.
+ *
+ */
+
+package scot.carricksoftware.grantswriter.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.grantswriter.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());
+    }
+
+    @Test
+    public void getIndustryOrServiceTest() {
+        assertNull(entry.getIndustryOrService());
+    }
+
+    @Test
+    public void setIndustryOrServiceTest() {
+        String string = GetRandomString();
+        entry.setIndustryOrService(string);
+        assertEquals(string, entry.getIndustryOrService());
+    }
+
+
+}

+ 78 - 0
src/test/java/scot/carricksoftware/grantswriter/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.grantswriter.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.grantswriter.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());
+    }
+
+
+}

+ 54 - 0
src/test/java/scot/carricksoftware/grantswriter/domains/census/CensusEnumTest.java

@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) Andrew Grant of Carrick Software 20/03/2025, 11:01. All rights reserved.
+ *
+ */
+
+package scot.carricksoftware.grantswriter.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 scot.carricksoftware.grantswriter.enums.census.CensusBoundaryType;
+import scot.carricksoftware.grantswriter.enums.census.CensusDate;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static scot.carricksoftware.grantswriter.GenerateCensusRandomEnums.GetRandomCensusBoundaryType;
+import static scot.carricksoftware.grantswriter.GenerateCensusRandomEnums.GetRandomCensusDate;
+
+@ExtendWith(MockitoExtension.class)
+class CensusEnumTest {
+
+    private Census census;
+
+    @BeforeEach
+    void setUp() {
+        census = new Census();
+    }
+
+    @Test
+    void getBoundaryType() {
+        assertNull(census.getBoundaryType());
+    }
+
+    @Test
+    void setBoundaryTypeTest() {
+        CensusBoundaryType boundaryType = GetRandomCensusBoundaryType();
+        census.setBoundaryType(boundaryType);
+        assertEquals(boundaryType, census.getBoundaryType());
+    }
+
+    @Test
+    public void getCensusDateTest() {
+        assertNull(census.getCensusDate());
+    }
+
+    @Test
+    public void setCensusDateTest() {
+        CensusDate date = GetRandomCensusDate();
+        census.setCensusDate(date);
+        assertEquals(date, census.getCensusDate());
+    }
+
+}

+ 92 - 0
src/test/java/scot/carricksoftware/grantswriter/domains/census/CensusPartOneTest.java

@@ -0,0 +1,92 @@
+/*
+ * Copyright (c) Andrew Grant of Carrick Software 19/03/2025, 01:42. All rights reserved.
+ *
+ */
+
+package scot.carricksoftware.grantswriter.domains.census;
+
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.ExtendWith;
+import org.mockito.Mock;
+import org.mockito.junit.jupiter.MockitoExtension;
+import scot.carricksoftware.grantswriter.domains.places.Place;
+import scot.carricksoftware.grantswriter.enums.census.CensusDate;
+
+
+import java.util.ArrayList;
+import java.util.List;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.mockito.Mockito.when;
+import static scot.carricksoftware.grantswriter.GenerateCensusRandomEnums.GetRandomCensusDate;
+import static scot.carricksoftware.grantswriter.GenerateCertificateRandomValues.GetRandomString;
+import static scot.carricksoftware.grantswriter.GenerateRandomCensusValues.GetRandomCensusEntry;
+import static scot.carricksoftware.grantswriter.GenerateRandomNumberValues.GetRandomLong;
+import static scot.carricksoftware.grantswriter.GenerateRandomPlaceValues.GetRandomPlace;
+
+
+@ExtendWith(MockitoExtension.class)
+public class CensusPartOneTest {
+
+    private Census census;
+
+    @BeforeEach
+    public void setUp() {
+        census = new Census();
+    }
+
+    @Mock
+    private Place placeMock;
+
+    @Test
+    public void getIdTest() {
+        assertNull(census.getId());
+    }
+
+    @Test
+    public void setIdTest() {
+        Long id = GetRandomLong();
+        census.setId(id);
+        assertEquals(id, census.getId());
+    }
+
+    @Test
+    public void getCensusEntriesTest() {
+        assertTrue(census.getCensusEntries().isEmpty());
+    }
+
+    @Test
+    public void setCensusEntriesTest() {
+        List<CensusEntry> censusEntries = new ArrayList<>();
+        censusEntries.add(GetRandomCensusEntry());
+        census.setCensusEntries(censusEntries);
+        assertEquals(censusEntries, census.getCensusEntries());
+    }
+
+    @Test
+    public void getPlaceTest() {
+        assertNull(census.getPlace());
+    }
+
+    @Test
+    public void setPlaceTest() {
+        Place place = GetRandomPlace();
+        census.setPlace(place);
+        assertEquals(place, census.getPlace());
+    }
+
+    @Test
+    public void toStringTest() {
+        CensusDate censusDate = GetRandomCensusDate();
+        String placeString = GetRandomString();
+        when(placeMock.toString()).thenReturn(placeString);
+        census.setCensusDate(censusDate);
+        census.setPlace(placeMock);
+        assertEquals(placeString + ", " + censusDate.label, census.toString());
+    }
+
+
+}

+ 102 - 0
src/test/java/scot/carricksoftware/grantswriter/domains/census/CensusPartTwoTest.java

@@ -0,0 +1,102 @@
+/*
+ * Copyright (c) Andrew Grant of Carrick Software 19/03/2025, 01:42. All rights reserved.
+ *
+ */
+
+package scot.carricksoftware.grantswriter.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.grantswriter.GenerateCertificateRandomValues.GetRandomString;
+
+
+@ExtendWith(MockitoExtension.class)
+public class CensusPartTwoTest {
+
+    private Census census;
+
+    @BeforeEach
+    public void setUp() {
+        census = new Census();
+    }
+
+    @Test
+    public void getFilledInByTest() {
+        assertNull(census.getFilledInBy());
+    }
+
+    @Test
+    public void setFilledInByTest() {
+        String filledInBy = GetRandomString();
+        census.setFilledInBy(filledInBy);
+        assertEquals(filledInBy, census.getFilledInBy());
+    }
+
+    @Test
+    public void getTotalRoomsTest() {
+        assertNull(census.getTotalRooms());
+    }
+
+    @Test
+    public void setTotalRoomsTest() {
+        String totalRooms = GetRandomString();
+        census.setTotalRooms(totalRooms);
+        assertEquals(totalRooms, census.getTotalRooms());
+    }
+
+    @Test
+    public void getRoomsOccupiedTest() {
+        assertNull(census.getRoomsOccupied());
+    }
+
+    @Test
+    public void setRoomOccupiedTest() {
+        String roomsOccupied = GetRandomString();
+        census.setRoomsOccupied(roomsOccupied);
+        assertEquals(roomsOccupied, census.getRoomsOccupied());
+    }
+
+    @Test
+    public void getInhabitedHousesTest() {
+        assertNull(census.getInhabitedRooms());
+    }
+
+    @Test
+    public void setInhabitedHousesTest() {
+        String inhabitedHouses = GetRandomString();
+        census.setInhabitedHouses(inhabitedHouses);
+        assertEquals(inhabitedHouses, census.getInhabitedHouses());
+    }
+
+
+    @Test
+    public void getUninhabitedHousesTest() {
+        assertNull(census.getUninhabitedHouses());
+    }
+
+    @Test
+    public void setUninhabitedHousesTest() {
+        String uninhabitedHouses = GetRandomString();
+        census.setUninhabitedHouses(uninhabitedHouses);
+        assertEquals(uninhabitedHouses, census.getUninhabitedHouses());
+    }
+
+    @Test
+    public void getPeopleInHousesTest() {
+        assertNull(census.getUninhabitedHouses());
+    }
+
+    @Test
+    public void setPeopleInHousesTest() {
+        String string = GetRandomString();
+        census.setPeopleInHouses(string);
+        assertEquals(string, census.getPeopleInHouses());
+    }
+
+
+}

+ 53 - 0
src/test/java/scot/carricksoftware/grantswriter/domains/census/CensusRoomsTest.java

@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) Andrew Grant of Carrick Software 19/03/2025, 01:42. All rights reserved.
+ *
+ */
+
+package scot.carricksoftware.grantswriter.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.*;
+import static scot.carricksoftware.grantswriter.GenerateCertificateRandomValues.GetRandomString;
+
+
+@ExtendWith(MockitoExtension.class)
+public class CensusRoomsTest {
+
+    private Census census;
+
+    @BeforeEach
+    public void setUp() {
+        census = new Census();
+    }
+
+    @Test
+    public void getInhabitedRoomsTest() {
+        assertNull(census.getInhabitedRooms());
+    }
+
+    @Test
+    public void setInhabitedRoomsTest() {
+        String string = GetRandomString();
+        census.setInhabitedRooms(string);
+        assertEquals(string, census.getInhabitedRooms());
+    }
+
+    @Test
+    public void getRoomsWithWidowsTest() {
+        assertNull(census.getRoomsWithWindows());
+    }
+
+    @Test
+    public void setRoomsWithWidowsTest() {
+        String string = GetRandomString();
+        census.setRoomsWithWindows(string);
+        assertEquals(string, census.getRoomsWithWindows());
+    }
+
+
+}

+ 1 - 1
src/test/java/scot/carricksoftware/grantswriter/domains/people/PersonTest.java

@@ -10,7 +10,7 @@ import org.junit.jupiter.api.Test;
 
 
 import static org.junit.jupiter.api.Assertions.*;
-import static scot.carricksoftware.grantswriter.GenerateRandomNumberValues.GetRandomString;
+import static scot.carricksoftware.grantswriter.GenerateCertificateRandomValues.GetRandomString;
 
 
 class PersonTest {

+ 5 - 2
src/test/java/scot/carricksoftware/grantswriter/files/WriterFilesTest.java

@@ -8,8 +8,11 @@ package scot.carricksoftware.grantswriter.files;
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
 
-import static org.junit.jupiter.api.Assertions.*;
-import static scot.carricksoftware.grantswriter.GenerateRandomNumberValues.GetRandomString;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+import static scot.carricksoftware.grantswriter.GenerateCertificateRandomValues.GetRandomString;
+
 
 class WriterFilesTest {
 

+ 2 - 1
src/test/java/scot/carricksoftware/grantswriter/writer/FileWriterTest.java

@@ -16,7 +16,8 @@ import java.util.List;
 import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.junit.jupiter.api.Assertions.assertNotNull;
 import static org.junit.jupiter.api.Assertions.assertNull;
-import static scot.carricksoftware.grantswriter.GenerateRandomNumberValues.GetRandomString;
+import static scot.carricksoftware.grantswriter.GenerateCertificateRandomValues.GetRandomString;
+
 
 class FileWriterTest {
 

+ 1 - 1
src/test/java/scot/carricksoftware/grantswriter/writer/TexWriterTest.java

@@ -17,7 +17,7 @@ import scot.carricksoftware.grantswriter.writer.latex.parts.PartsWriter;
 
 import static org.mockito.ArgumentMatchers.anyString;
 import static org.mockito.Mockito.inOrder;
-import static scot.carricksoftware.grantswriter.GenerateRandomNumberValues.GetRandomString;
+import static scot.carricksoftware.grantswriter.GenerateCertificateRandomValues.GetRandomString;
 
 @ExtendWith(MockitoExtension.class)
 class TexWriterTest {

+ 1 - 1
src/test/java/scot/carricksoftware/grantswriter/writer/latex/LatexPartHeaderTest.java

@@ -13,7 +13,7 @@ import org.mockito.junit.jupiter.MockitoExtension;
 import scot.carricksoftware.grantswriter.writer.FileWriter;
 
 import static org.mockito.Mockito.verify;
-import static scot.carricksoftware.grantswriter.GenerateRandomNumberValues.GetRandomString;
+import static scot.carricksoftware.grantswriter.GenerateCertificateRandomValues.GetRandomString;
 
 @ExtendWith(MockitoExtension.class)
 class LatexPartHeaderTest {

+ 1 - 1
src/test/java/scot/carricksoftware/grantswriter/writer/latex/LatexSectionHeaderTest.java

@@ -13,7 +13,7 @@ import org.mockito.junit.jupiter.MockitoExtension;
 import scot.carricksoftware.grantswriter.writer.FileWriter;
 
 import static org.mockito.Mockito.verify;
-import static scot.carricksoftware.grantswriter.GenerateRandomNumberValues.GetRandomString;
+import static scot.carricksoftware.grantswriter.GenerateCertificateRandomValues.GetRandomString;
 
 @ExtendWith(MockitoExtension.class)
 class LatexSectionHeaderTest {