Эх сурвалжийг харах

Added Death Certificate Domain, Service and Repository (2)

Andrew Grant 2 сар өмнө
parent
commit
b9dcc0ebe9

+ 64 - 0
src/test/java/scot/carricksoftware/grantswriter/domains/certificates/deathcertificate/DeathCertificateMilitaryTest.java

@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2025.  Andrew Grant Carrick Software. All rights reserved
+ *
+ */
+
+package scot.carricksoftware.grantswriter.domains.certificates.deathcertificate;
+
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static scot.carricksoftware.grantswriter.GenerateCertificateRandomValues.GetRandomString;
+
+
+class DeathCertificateMilitaryTest {
+
+    private DeathCertificate deathCertificate;
+
+    @BeforeEach
+    void setUp() {
+        deathCertificate = new DeathCertificate();
+    }
+
+    @Test
+    void getRegimentTest() {
+        assertNull(deathCertificate.getRegiment());
+    }
+
+    @Test
+    void setRegimentTest() {
+        String regiment = GetRandomString();
+        deathCertificate.setRegiment(regiment);
+        assertEquals(regiment, deathCertificate.getRegiment());
+    }
+
+    @Test
+    void getServiceNumberTest() {
+        assertNull(deathCertificate.getServiceNumber());
+    }
+
+    @Test
+    void setServiceNumberTest() {
+        String serviceNumber = GetRandomString();
+        deathCertificate.setServiceNumber(serviceNumber);
+        assertEquals(serviceNumber, deathCertificate.getServiceNumber());
+    }
+
+    @Test
+    void getServiceRankTest() {
+        assertNull(deathCertificate.getServiceRank());
+    }
+
+    @Test
+    void setServiceRankTest() {
+        String serviceRank = GetRandomString();
+        deathCertificate.setServiceRank(serviceRank);
+        assertEquals(serviceRank, deathCertificate.getServiceRank());
+    }
+
+
+
+
+}

+ 88 - 0
src/test/java/scot/carricksoftware/grantswriter/domains/certificates/deathcertificate/DeathCertificatePersonTest.java

@@ -0,0 +1,88 @@
+/*
+ * Copyright (c) 2025.  Andrew Grant Carrick Software. All rights reserved
+ *
+ */
+
+package scot.carricksoftware.grantswriter.domains.certificates.deathcertificate;
+
+import org.junit.jupiter.api.BeforeEach;
+
+import org.junit.jupiter.api.Test;
+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 scot.carricksoftware.grantswriter.GenerateRandomPeopleValues.GetRandomPerson;
+
+
+class DeathCertificatePersonTest {
+
+    private DeathCertificate deathCertificate;
+
+    @BeforeEach
+    void setUp() {
+        deathCertificate = new DeathCertificate();
+    }
+
+    @Test
+    void getDeceasedTest() {
+        assertNull(deathCertificate.getDeceased());
+    }
+
+    @Test
+    void setDeceasedTest() {
+        Person deceased = GetRandomPerson();
+        deathCertificate.setDeceased(deceased);
+        assertEquals(deceased, deathCertificate.getDeceased());
+    }
+
+    @Test
+    void getFatherTest() {
+        assertNull(deathCertificate.getFather());
+    }
+
+    @Test
+    void setFatherTest() {
+        Person father = GetRandomPerson();
+        deathCertificate.setFather(father);
+        assertEquals(father, deathCertificate.getFather());
+    }
+
+    @Test
+    void getMotherTest() {
+        assertNull(deathCertificate.getMother());
+    }
+
+    @Test
+    void setMotherTest() {
+        Person mother = GetRandomPerson();
+        deathCertificate.setMother(mother);
+        assertEquals(mother, deathCertificate.getMother());
+    }
+
+    @Test
+    void getInformantTest() {
+        assertNull(deathCertificate.getInformant());
+    }
+
+    @Test
+    void setInformantTest() {
+        Person informant = GetRandomPerson();
+        deathCertificate.setInformant(informant);
+        assertEquals(informant, deathCertificate.getInformant());
+    }
+
+    @Test
+    void getSpouseTest() {
+        assertNull(deathCertificate.getSpouse());
+    }
+
+    @Test
+    void setSpouseTest() {
+        Person spouse = GetRandomPerson();
+        deathCertificate.setSpouse(spouse);
+        assertEquals(spouse, deathCertificate.getSpouse());
+    }
+
+
+}

+ 77 - 0
src/test/java/scot/carricksoftware/grantswriter/domains/certificates/deathcertificate/DeathCertificatePlaceTest.java

@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2025.  Andrew Grant Carrick Software. All rights reserved
+ *
+ */
+
+package scot.carricksoftware.grantswriter.domains.certificates.deathcertificate;
+
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import scot.carricksoftware.grantswriter.domains.places.Place;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static scot.carricksoftware.grantswriter.GenerateCertificateRandomValues.GetRandomString;
+import static scot.carricksoftware.grantswriter.GenerateRandomPlaceValues.GetRandomPlace;
+
+
+class DeathCertificatePlaceTest {
+
+    private DeathCertificate deathCertificate;
+
+    @BeforeEach
+    void setUp() {
+        deathCertificate = new DeathCertificate();
+    }
+
+
+    @Test
+    void getWhereRegisteredTest() {
+        assertNull(deathCertificate.getWhereRegistered());
+    }
+
+    @Test
+    void setWhereRegisteredTest() {
+        String whereRegistered = GetRandomString();
+        deathCertificate.setWhereRegistered(whereRegistered);
+        assertEquals(whereRegistered, deathCertificate.getWhereRegistered());
+    }
+
+    @Test
+    void getInformantAddressTest() {
+        assertNull(deathCertificate.getInformantAddress());
+    }
+
+    @Test
+    void setInformantAddressTest() {
+        String informantAddress = GetRandomString();
+        deathCertificate.setInformantAddress(informantAddress);
+        assertEquals(informantAddress, deathCertificate.getInformantAddress());
+    }
+
+    @Test
+    void getWhereDiedTest() {
+        assertNull(deathCertificate.getWhereDied());
+    }
+
+    @Test
+    void setWhereDiedTest() {
+        Place whereDied = GetRandomPlace();
+        deathCertificate.setWhereDied(whereDied);
+        assertEquals(whereDied, deathCertificate.getWhereDied());
+    }
+
+    @Test
+    void getUsualResidenceTest() {
+        assertNull(deathCertificate.getUsualResidence());
+    }
+
+    @Test
+    void setUsualResidenceTest() {
+        Place usualResidence = GetRandomPlace();
+        deathCertificate.setUsualResidence(usualResidence);
+        assertEquals(usualResidence, deathCertificate.getUsualResidence());
+    }
+
+
+}

+ 100 - 0
src/test/java/scot/carricksoftware/grantswriter/domains/certificates/deathcertificate/DeathCertificateTest.java

@@ -0,0 +1,100 @@
+/*
+ * Copyright (c) 2025.  Andrew Grant Carrick Software. All rights reserved
+ *
+ */
+
+package scot.carricksoftware.grantswriter.domains.certificates.deathcertificate;
+
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import scot.carricksoftware.grantswriter.enums.general.Sex;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static scot.carricksoftware.grantswriter.GenerateCertificateRandomValues.GetRandomString;
+
+
+class DeathCertificateTest {
+
+    private DeathCertificate deathCertificate;
+
+    @BeforeEach
+    void setUp() {
+        deathCertificate = new DeathCertificate();
+    }
+
+
+    @Test
+    void getSexTest() {
+        assertNull(deathCertificate.getSex());
+    }
+
+    @Test
+    void setSexTest() {
+        Sex sex = Sex.MALE;
+        deathCertificate.setSex(sex);
+        assertEquals(sex, deathCertificate.getSex());
+    }
+
+    @Test
+    void getOccupationTest() {
+        assertNull(deathCertificate.getOccupation());
+    }
+
+    @Test
+    void setOccupationTest() {
+        String occupation = GetRandomString();
+        deathCertificate.setOccupation(occupation);
+        assertEquals(occupation, deathCertificate.getOccupation());
+    }
+
+    @Test
+    void getSpouseOccupationTest() {
+        assertNull(deathCertificate.getSpouseOccupation());
+    }
+
+    @Test
+    void setSpouseOccupationTest() {
+        String spouseOccupation = GetRandomString();
+        deathCertificate.setSpouseOccupation(spouseOccupation);
+        assertEquals(spouseOccupation, deathCertificate.getSpouseOccupation());
+    }
+
+    @Test
+    void getFatherOccupationTest() {
+        assertNull(deathCertificate.getFatherOccupation());
+    }
+
+    @Test
+    void setFatherOccupationTest() {
+        String fatherOccupation = GetRandomString();
+        deathCertificate.setFatherOccupation(fatherOccupation);
+        assertEquals(fatherOccupation, deathCertificate.getFatherOccupation());
+    }
+
+    @Test
+    void getMotherOccupationTest() {
+        assertNull(deathCertificate.getMotherOccupation());
+    }
+
+    @Test
+    void setMotherOccupationTest() {
+        String motherOccupation = GetRandomString();
+        deathCertificate.setMotherOccupation(motherOccupation);
+        assertEquals(motherOccupation, deathCertificate.getMotherOccupation());
+    }
+
+    @Test
+    void getMaritalStatusTest() {
+        assertNull(deathCertificate.getMaritalStatus());
+    }
+
+    @Test
+    void setMaritalStatusTest() {
+        String maritalStatus = GetRandomString();
+        deathCertificate.setMaritalStatus(maritalStatus);
+        assertEquals(maritalStatus, deathCertificate.getMaritalStatus());
+    }
+
+
+}

+ 76 - 0
src/test/java/scot/carricksoftware/grantswriter/domains/certificates/deathcertificate/DeathCertificateTimeTest.java

@@ -0,0 +1,76 @@
+/*
+ * Copyright (c) 2025.  Andrew Grant Carrick Software. All rights reserved
+ *
+ */
+
+package scot.carricksoftware.grantswriter.domains.certificates.deathcertificate;
+
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static scot.carricksoftware.grantswriter.GenerateCertificateRandomValues.GetRandomString;
+
+
+class DeathCertificateTimeTest {
+
+    private DeathCertificate deathCertificate;
+
+    @BeforeEach
+    void setUp() {
+        deathCertificate = new DeathCertificate();
+    }
+
+
+    @Test
+    void getWhenBornTest() {
+        assertNull(deathCertificate.getWhenBorn());
+    }
+
+    @Test
+    void setWhenBornTest() {
+        String whenBorn = GetRandomString();
+        deathCertificate.setWhenBorn(whenBorn);
+        assertEquals(whenBorn, deathCertificate.getWhenBorn());
+    }
+
+    @Test
+    void getAgeTest() {
+        assertNull(deathCertificate.getAge());
+    }
+
+    @Test
+    void setAgeTest() {
+        String age = GetRandomString();
+        deathCertificate.setAge(age);
+        assertEquals(age, deathCertificate.getAge());
+    }
+
+    @Test
+    void getWhenDiedTest() {
+        assertNull(deathCertificate.getWhenDied());
+    }
+
+    @Test
+    void setWhenDiedTest() {
+        String whenDied = GetRandomString();
+        deathCertificate.setWhenDied(whenDied);
+        assertEquals(whenDied, deathCertificate.getWhenDied());
+    }
+
+    @Test
+    void getWhenRegisteredTest() {
+        assertNull(deathCertificate.getWhenRegistered());
+    }
+
+    @Test
+    void setWhenRegisteredTest() {
+        String whenRegistered = GetRandomString();
+        deathCertificate.setWhenRegistered(whenRegistered);
+        assertEquals(whenRegistered, deathCertificate.getWhenRegistered());
+    }
+
+
+
+}

+ 51 - 0
src/test/java/scot/carricksoftware/grantswriter/domains/certificates/deathcertificate/DeathCertificateTwoTest.java

@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2025.  Andrew Grant Carrick Software. All rights reserved
+ *
+ */
+
+package scot.carricksoftware.grantswriter.domains.certificates.deathcertificate;
+
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static scot.carricksoftware.grantswriter.GenerateCertificateRandomValues.GetRandomString;
+
+
+class DeathCertificateTwoTest {
+
+    private DeathCertificate deathCertificate;
+
+    @BeforeEach
+    void setUp() {
+        deathCertificate = new DeathCertificate();
+    }
+    
+    @Test
+    void getCauseOfDeathTest() {
+        assertNull(deathCertificate.getCauseOfDeath());
+    }
+
+    @Test
+    void setCauseOfDeathTest() {
+        String causeOfDeath = GetRandomString();
+        deathCertificate.setCauseOfDeath(causeOfDeath);
+        assertEquals(causeOfDeath, deathCertificate.getCauseOfDeath());
+    }
+
+    @Test
+    void getInformantQualificationTest() {
+        assertNull(deathCertificate.getInformantQualification());
+    }
+
+    @Test
+    void setInformantQualificationTest() {
+        String informantQualification = GetRandomString();
+        deathCertificate.setInformantQualification(informantQualification);
+        assertEquals(informantQualification, deathCertificate.getInformantQualification());
+    }
+
+
+
+}

+ 98 - 0
src/test/java/scot/carricksoftware/grantswriter/domains/certificates/deathcertificate/DeathCertificateUntrackedTest.java

@@ -0,0 +1,98 @@
+/*
+ * Copyright (c) 2025.  Andrew Grant Carrick Software. All rights reserved
+ *
+ */
+
+package scot.carricksoftware.grantswriter.domains.certificates.deathcertificate;
+
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static scot.carricksoftware.grantswriter.GenerateCertificateRandomValues.GetRandomString;
+
+
+class DeathCertificateUntrackedTest {
+
+    private DeathCertificate deathCertificate;
+
+    @BeforeEach
+    void setUp() {
+        deathCertificate = new DeathCertificate();
+    }
+
+    @Test
+    void getUntrackedWhereDied() {
+        assertNull(deathCertificate.getUntrackedWhereDied());
+    }
+
+    @Test
+    void setUntrackedWhereDied() {
+        String untrackedWhereDied = GetRandomString();
+        deathCertificate.setUntrackedWhereDied(untrackedWhereDied);
+        assertEquals(untrackedWhereDied, deathCertificate.getUntrackedWhereDied());
+    }
+
+    @Test
+    void getUntrackedSpouse() {
+        assertNull(deathCertificate.getUntrackedSpouse());
+    }
+
+    @Test
+    void setUntrackedSpouse() {
+        String untrackedSpouse = GetRandomString();
+        deathCertificate.setUntrackedSpouse(untrackedSpouse);
+        assertEquals(untrackedSpouse, deathCertificate.getUntrackedSpouse());
+    }
+
+    @Test
+    void getUntrackedFather() {
+        assertNull(deathCertificate.getUntrackedFather());
+    }
+
+    @Test
+    void setUntrackedFather() {
+        String untrackedFather = GetRandomString();
+        deathCertificate.setUntrackedFather(untrackedFather);
+        assertEquals(untrackedFather, deathCertificate.getUntrackedFather());
+    }
+
+    @Test
+    void getUntrackedMother() {
+        assertNull(deathCertificate.getUntrackedMother());
+    }
+
+    @Test
+    void setUntrackedMother() {
+        String untrackedMother = GetRandomString();
+        deathCertificate.setUntrackedMother(untrackedMother);
+        assertEquals(untrackedMother, deathCertificate.getUntrackedMother());
+    }
+
+    @Test
+    void getUntrackedInformant() {
+        assertNull(deathCertificate.getUntrackedInformant());
+    }
+
+    @Test
+    void setUntrackedInformant() {
+        String untrackedInformant = GetRandomString();
+        deathCertificate.setUntrackedInformant(untrackedInformant);
+        assertEquals(untrackedInformant, deathCertificate.getUntrackedInformant());
+    }
+
+    @Test
+    void getUntrackedUsualResidence() {
+        assertNull(deathCertificate.getUntrackedUsualResidence());
+    }
+
+    @Test
+    void setUntrackedUsualResidence() {
+        String untrackedUsualResidence = GetRandomString();
+        deathCertificate.setUntrackedUsualResidence(untrackedUsualResidence);
+        assertEquals(untrackedUsualResidence, deathCertificate.getUntrackedUsualResidence());
+    }
+
+
+}