瀏覽代碼

DeathCertificateCommand Tests

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

+ 81 - 5
src/test/java/scot/carricksoftware/grants/commands/certificates/death/DeathCertificateCommandTest.java

@@ -9,30 +9,106 @@ import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
 import scot.carricksoftware.grants.commands.certificates.deathcertificates.DeathCertificateCommand;
 import scot.carricksoftware.grants.commands.certificates.deathcertificates.DeathCertificateCommandImpl;
+import scot.carricksoftware.grants.enums.general.Sex;
 
 import static org.junit.jupiter.api.Assertions.*;
+import static scot.carricksoftware.grants.GenerateCertificateRandomValues.GetRandomString;
 import static scot.carricksoftware.grants.GenerateRandomNumberValues.GetRandomLong;
 
 class DeathCertificateCommandTest {
 
-    private DeathCertificateCommand command;
+    private DeathCertificateCommand deathCertificateCommand;
 
     @BeforeEach
     void setUp() {
-        command = new DeathCertificateCommandImpl();
+        deathCertificateCommand = new DeathCertificateCommandImpl();
     }
 
     @Test
     void getIdTest() {
-        assertNull(command.getId());
+        assertNull(deathCertificateCommand.getId());
     }
 
     @Test
     void setIdTest() {
         Long id = GetRandomLong();
-        command.setId(id);
-        assertEquals(id, command.getId());
+        deathCertificateCommand.setId(id);
+        assertEquals(id, deathCertificateCommand.getId());
     }
 
+    @Test
+    void getSexTest() {
+        assertNull(deathCertificateCommand.getSex());
+    }
+
+    @Test
+    void setSexTest() {
+        Sex sex = Sex.MALE;
+        deathCertificateCommand.setSex(sex);
+        assertEquals(sex, deathCertificateCommand.getSex());
+    }
+
+    @Test
+    void getOccupationTest() {
+        assertNull(deathCertificateCommand.getOccupation());
+    }
+
+    @Test
+    void setOccupationTest() {
+        String occupation = GetRandomString();
+        deathCertificateCommand.setOccupation(occupation);
+        assertEquals(occupation, deathCertificateCommand.getOccupation());
+    }
+
+    @Test
+    void getSpouseOccupationTest() {
+        assertNull(deathCertificateCommand.getSpouseOccupation());
+    }
+
+    @Test
+    void setSpouseOccupationTest() {
+        String spouseOccupation = GetRandomString();
+        deathCertificateCommand.setSpouseOccupation(spouseOccupation);
+        assertEquals(spouseOccupation, deathCertificateCommand.getSpouseOccupation());
+    }
+
+    @Test
+    void getFatherOccupationTest() {
+        assertNull(deathCertificateCommand.getFatherOccupation());
+    }
+
+    @Test
+    void setFatherOccupationTest() {
+        String fatherOccupation = GetRandomString();
+        deathCertificateCommand.setFatherOccupation(fatherOccupation);
+        assertEquals(fatherOccupation, deathCertificateCommand.getFatherOccupation());
+    }
+
+    @Test
+    void getMotherOccupationTest() {
+        assertNull(deathCertificateCommand.getMotherOccupation());
+    }
+
+    @Test
+    void setMotherOccupationTest() {
+        String motherOccupation = GetRandomString();
+        deathCertificateCommand.setMotherOccupation(motherOccupation);
+        assertEquals(motherOccupation, deathCertificateCommand.getMotherOccupation());
+    }
+
+    @Test
+    void getMaritalStatusTest() {
+        assertNull(deathCertificateCommand.getMaritalStatus());
+    }
+
+    @Test
+    void setMaritalStatusTest() {
+        String maritalStatus = GetRandomString();
+        deathCertificateCommand.setMaritalStatus(maritalStatus);
+        assertEquals(maritalStatus, deathCertificateCommand.getMaritalStatus());
+    }
+
+
+
 
 }

+ 77 - 0
src/test/java/scot/carricksoftware/grants/commands/certificates/death/DeathCertificateCommandTimeTest.java

@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2025.  Andrew Grant Carrick Software. All rights reserved
+ *
+ */
+
+package scot.carricksoftware.grants.commands.certificates.death;
+
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import scot.carricksoftware.grants.commands.certificates.deathcertificates.DeathCertificateCommand;
+import scot.carricksoftware.grants.commands.certificates.deathcertificates.DeathCertificateCommandImpl;
+
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static scot.carricksoftware.grants.GenerateCertificateRandomValues.GetRandomString;
+
+
+class DeathCertificateCommandTimeTest {
+
+    private DeathCertificateCommand deathCertificateCommand;
+
+    @BeforeEach
+    void setUp() {
+        deathCertificateCommand = new DeathCertificateCommandImpl();
+    }
+
+
+    @Test
+    void getWhenBornTest() {
+        assertNull(deathCertificateCommand.getWhenBorn());
+    }
+
+    @Test
+    void setWhenBornTest() {
+        String whenBorn = GetRandomString();
+        deathCertificateCommand.setWhenBorn(whenBorn);
+        assertEquals(whenBorn, deathCertificateCommand.getWhenBorn());
+    }
+
+    @Test
+    void getAgeTest() {
+        assertNull(deathCertificateCommand.getAge());
+    }
+
+    @Test
+    void setAgeTest() {
+        String age = GetRandomString();
+        deathCertificateCommand.setAge(age);
+        assertEquals(age, deathCertificateCommand.getAge());
+    }
+
+    @Test
+    void getWhenDiedTest() {
+        assertNull(deathCertificateCommand.getWhenDied());
+    }
+
+    @Test
+    void setWhenDiedTest() {
+        String whenDied = GetRandomString();
+        deathCertificateCommand.setWhenDied(whenDied);
+        assertEquals(whenDied, deathCertificateCommand.getWhenDied());
+    }
+
+    @Test
+    void getWhenRegistered() {
+        assertNull(deathCertificateCommand.getWhenRegistered());
+    }
+
+    @Test
+    void setWhenRegisteredTest() {
+        String whenRegistered = GetRandomString();
+        deathCertificateCommand.setWhenRegistered(whenRegistered);
+        assertEquals(whenRegistered, deathCertificateCommand.getWhenRegistered());
+    }
+
+}