瀏覽代碼

Domain Test (4)

Andrew Grant 4 月之前
父節點
當前提交
02e1a8bc00

+ 26 - 0
src/test/java/scot/carricksoftware/grants/domains/certificates/death/DeathCertificatePlaceTest.java

@@ -8,10 +8,12 @@ package scot.carricksoftware.grants.domains.certificates.death;
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
 import scot.carricksoftware.grants.domains.certificates.DeathCertificate;
+import scot.carricksoftware.grants.domains.places.Place;
 
 import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.junit.jupiter.api.Assertions.assertNull;
 import static scot.carricksoftware.grants.GenerateCertificateRandomValues.GetRandomString;
+import static scot.carricksoftware.grants.GenerateRandomPlaceValues.GetRandomPlace;
 
 
 class DeathCertificatePlaceTest {
@@ -48,4 +50,28 @@ class DeathCertificatePlaceTest {
         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());
+    }
+
 }

+ 12 - 0
src/test/java/scot/carricksoftware/grants/domains/certificates/death/DeathCertificateTest.java

@@ -85,5 +85,17 @@ class DeathCertificateTest {
         assertEquals(motherOccupation, deathCertificate.getMotherOccupation());
     }
 
+    @Test
+    void getMaritalStatusTest() {
+        assertNull(deathCertificate.getMaritalStatus());
+    }
+
+    @Test
+    void setMaritalStatusTest() {
+        String maritalStatus = GetRandomString();
+        deathCertificate.setMaritalStatus(maritalStatus);
+        assertEquals(maritalStatus, deathCertificate.getMaritalStatus());
+    }
+
 
 }

+ 39 - 0
src/test/java/scot/carricksoftware/grants/domains/certificates/death/DeathCertificateTwoTest.java

@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2025.  Andrew Grant Carrick Software. All rights reserved
+ *
+ */
+
+package scot.carricksoftware.grants.domains.certificates.death;
+
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import scot.carricksoftware.grants.domains.certificates.DeathCertificate;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static scot.carricksoftware.grants.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());
+    }
+
+}

+ 12 - 0
src/test/java/scot/carricksoftware/grants/domains/certificates/death/DeathCertificateUntrackedTest.java

@@ -83,5 +83,17 @@ class DeathCertificateUntrackedTest {
         assertEquals(untrackedInformant, deathCertificate.getUntrackedInformant());
     }
 
+    @Test
+    void getUntrackedUsualResidence() {
+        assertNull(deathCertificate.getUntrackedUsualResidence());
+    }
+
+    @Test
+    void setUntrackedUsualResidence() {
+        String untrackedUsualResidence = GetRandomString();
+        deathCertificate.setUntrackedUsualResidence(untrackedUsualResidence);
+        assertEquals(untrackedUsualResidence, deathCertificate.getUntrackedUsualResidence());
+    }
+
 
 }