Browse Source

Birth Certificate domain Tests

Andrew Grant 2 months ago
parent
commit
cf534213e5

+ 30 - 1
src/main/java/scot/carricksoftware/grantswriter/domains/certificates/birthcertificate/BirthCertificate.java

@@ -100,7 +100,6 @@ public class BirthCertificate extends BaseEntity {
         return whenBorn;
     }
 
-
     public Place getWhereBorn() {
         return whereBorn;
     }
@@ -120,4 +119,34 @@ public class BirthCertificate extends BaseEntity {
     public String getUntrackedInformant() {
         return untrackedInformant;
     }
+
+    @SuppressWarnings("unused")
+    public void setWhenBorn(String whenBorn) {
+        this.whenBorn = whenBorn;
+    }
+
+    @SuppressWarnings("unused")
+    public void setWhereBorn(Place whereBorn) {
+        this.whereBorn = whereBorn;
+    }
+
+    @SuppressWarnings("unused")
+    public void setUntrackedWhereBorn(String untrackedWhereBorn) {
+        this.untrackedWhereBorn = untrackedWhereBorn;
+    }
+
+    @SuppressWarnings("unused")
+    public void setWhenRegistered(String whenRegistered) {
+        this.whenRegistered = whenRegistered;
+    }
+
+    @SuppressWarnings("unused")
+    public void setWhereRegistered(String whereRegistered) {
+        this.whereRegistered = whereRegistered;
+    }
+
+    @SuppressWarnings("unused")
+    public void setUntrackedInformant(String untrackedInformant) {
+        this.untrackedInformant = untrackedInformant;
+    }
 }

+ 49 - 0
src/test/java/scot/carricksoftware/grantswriter/domains/certificates/birthcertificate/BirthCertificateDateTest.java

@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2025.  Andrew Grant Carrick Software. All rights reserved
+ *
+ */
+
+package scot.carricksoftware.grantswriter.domains.certificates.birthcertificate;
+
+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;
+import static scot.carricksoftware.grantswriter.GenerateRandomNumberValues.GetRandomLong;
+
+class BirthCertificateDateTest {
+
+    BirthCertificate birthCertificate;
+
+    @BeforeEach
+    void setUp() {
+        birthCertificate = new BirthCertificate();
+    }
+
+    @Test
+    void getIDTest() {
+        assertNull(birthCertificate.getId());
+    }
+
+    @Test
+    void setIDTest() {
+        Long id = GetRandomLong();
+        birthCertificate.setId(id);
+        assertEquals(id, birthCertificate.getId());
+    }
+
+    @Test
+    void getWhenBornTest() {
+        assertNull(birthCertificate.getWhenBorn());
+    }
+
+    @Test
+    void setWhenBornTest() {
+        String whenBorn = GetRandomString();
+        birthCertificate.setWhenBorn(whenBorn);
+        assertEquals(whenBorn, birthCertificate.getWhenBorn());
+    }
+
+}

+ 1 - 14
src/test/java/scot/carricksoftware/grantswriter/domains/certificates/birthcertificate/BirthCertificateTest.java → src/test/java/scot/carricksoftware/grantswriter/domains/certificates/birthcertificate/BirthCertificatePeopleTest.java

@@ -10,10 +10,9 @@ import org.junit.jupiter.api.Test;
 import scot.carricksoftware.grantswriter.domains.people.Person;
 
 import static org.junit.jupiter.api.Assertions.*;
-import static scot.carricksoftware.grantswriter.GenerateRandomNumberValues.GetRandomLong;
 import static scot.carricksoftware.grantswriter.GenerateRandomPeopleValues.GetRandomPerson;
 
-class BirthCertificateTest {
+class BirthCertificatePeopleTest {
 
     BirthCertificate birthCertificate;
 
@@ -22,18 +21,6 @@ class BirthCertificateTest {
         birthCertificate = new BirthCertificate();
     }
 
-    @Test
-    void getIDTest() {
-        assertNull(birthCertificate.getId());
-    }
-
-    @Test
-    void setIDTest() {
-        Long id = GetRandomLong();
-        birthCertificate.setId(id);
-        assertEquals(id, birthCertificate.getId());
-    }
-
     @Test
     void getNewBornTest() {
         assertNull(birthCertificate.getNewBorn());

+ 55 - 0
src/test/java/scot/carricksoftware/grantswriter/domains/certificates/birthcertificate/BirthCertificatePlaceTest.java

@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 2025.  Andrew Grant Carrick Software. All rights reserved
+ *
+ */
+
+package scot.carricksoftware.grantswriter.domains.certificates.birthcertificate;
+
+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 BirthCertificatePlaceTest {
+
+    BirthCertificate birthCertificate;
+
+    @BeforeEach
+    void setUp() {
+        birthCertificate = new BirthCertificate();
+    }
+
+    @Test
+    void getIDTest() {
+        assertNull(birthCertificate.getId());
+    }
+
+    @Test
+    void getWhereBornTest() {
+        assertNull(birthCertificate.getWhereBorn());
+    }
+
+    @Test
+    void setWhereBornTest() {
+        Place whereBorn = GetRandomPlace();
+        birthCertificate.setWhereBorn(whereBorn);
+        assertEquals(whereBorn, birthCertificate.getWhereBorn());
+    }
+
+    @Test
+    void getUntrackedWhereBornTest() {
+        assertNull(birthCertificate.getUntrackedWhereBorn());
+    }
+
+    @Test
+    void setUntrackedWhereBornTest() {
+        String whereBorn = GetRandomString();
+        birthCertificate.setUntrackedWhereBorn(whereBorn);
+        assertEquals(whereBorn, birthCertificate.getUntrackedWhereBorn());
+    }
+
+}