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

Death Certificate add base certificate attributes Tests

Andrew Grant 4 сар өмнө
parent
commit
f63942f5a4

+ 0 - 1
src/test/java/scot/carricksoftware/grants/bootstrap/DataLoadCertificatesDeathCertificatesTest.java

@@ -72,7 +72,6 @@ public class DataLoadCertificatesDeathCertificatesTest {
 
         dataLoadCertificates.load();
         verify(deathCertificateServiceMock).saveDeathCertificateCommand(captor.capture());
-        var debug = captor.getValue();
         assertEquals(deceased, captor.getValue().getDeceased());
         assertEquals(father, captor.getValue().getFather());
 

+ 41 - 0
src/test/java/scot/carricksoftware/grants/domains/certificates/death/DeathCertificateOrganisationTest.java

@@ -0,0 +1,41 @@
+/*
+ * 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 scot.carricksoftware.grants.domains.places.Organisation;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static scot.carricksoftware.grants.GenerateRandomPlaceValues.GetRandomOrganisation;
+
+
+class DeathCertificateOrganisationTest {
+
+    private DeathCertificate deathCertificate;
+
+    @BeforeEach
+    void setUp() {
+        deathCertificate = new DeathCertificate();
+    }
+
+    @Test
+    void getCertificateSourceTest() {
+        assertNull(deathCertificate.getCertificateSource());
+    }
+
+    @Test
+    void setCertificateSourceTest() {
+        Organisation certificateSource = GetRandomOrganisation();
+        deathCertificate.setCertificateSource(certificateSource);
+        assertEquals(certificateSource, deathCertificate.getCertificateSource());
+    }
+
+
+
+}

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

@@ -74,4 +74,5 @@ class DeathCertificatePlaceTest {
         assertEquals(usualResidence, deathCertificate.getUsualResidence());
     }
 
+
 }

+ 13 - 1
src/test/java/scot/carricksoftware/grants/domains/certificates/death/DeathCertificateTimeTest.java

@@ -61,7 +61,7 @@ class DeathCertificateTimeTest {
     }
 
     @Test
-    void getWhenRegistered() {
+    void getWhenRegisteredTest() {
         assertNull(deathCertificate.getWhenRegistered());
     }
 
@@ -72,4 +72,16 @@ class DeathCertificateTimeTest {
         assertEquals(whenRegistered, deathCertificate.getWhenRegistered());
     }
 
+    @Test
+    void getCertificateDateTest() {
+        assertNull(deathCertificate.getCertificateDate());
+    }
+
+    @Test
+    void setCertificateDateTest() {
+        String certificateDate = GetRandomString();
+        deathCertificate.setCertificateDate(certificateDate);
+        assertEquals(certificateDate, deathCertificate.getCertificateDate());
+    }
+
 }

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

@@ -47,4 +47,16 @@ class DeathCertificateTwoTest {
         assertEquals(informantQualification, deathCertificate.getInformantQualification());
     }
 
+    @Test
+    void getCertificateNumberTest() {
+        assertNull(deathCertificate.getCertificateNumber());
+    }
+
+    @Test
+    void setCertificateNumberTest() {
+        String certificateNumber = GetRandomString();
+        deathCertificate.setCertificateNumber(certificateNumber);
+        assertEquals(certificateNumber, deathCertificate.getInformantQualification());
+    }
+
 }