Explorar o código

DivorceCertificate Domain Test

Andrew Grant hai 1 mes
pai
achega
6189b98e4a

+ 0 - 1
src/main/java/scot/carricksoftware/grantswriter/domains/people/Person.java

@@ -26,7 +26,6 @@ public class Person extends BaseEntity {
     @Column(name = "`recorded_year_of_birth`")
     private String recordedYearOfBirth;
 
-    @SuppressWarnings("JpaDataSourceORMInspection")
     @Column(name = "`certified_year_of_death`")
     String certifiedYearOfDeath;
 

+ 67 - 0
src/test/java/scot/carricksoftware/grantswriter/domains/certificates/divorcecertificate/DivorceCertificateDateTest.java

@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2025.  Andrew Grant Carrick Software. All rights reserved
+ *
+ */
+
+package scot.carricksoftware.grantswriter.domains.certificates.divorcecertificate;
+
+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 DivorceCertificateDateTest {
+
+    private DivorceCertificate certificate;
+
+    @BeforeEach
+    void setUp() {
+        certificate = new DivorceCertificate();
+    }
+
+    @Test
+    public void getFirstPartyDateTest() {
+        assertNull(certificate.getFirstPartyDate());
+    }
+
+    @Test
+    public void setFirstPartyDateTest() {
+        String string = GetRandomString();
+        certificate.setFirstPartyDate(string);
+        assertEquals(string, certificate.getFirstPartyDate());
+    }
+
+    @Test
+    public void getSecondPartyDateTest() {
+        assertNull(certificate.getSecondPartyDate());
+    }
+
+    @Test
+    public void setSecondPartyDateTest() {
+        String string = GetRandomString();
+        certificate.setSecondPartyDate(string);
+        assertEquals(string, certificate.getSecondPartyDate());
+    }
+
+    @Test
+    public void getRegisteredDateTest() {
+        assertNull(certificate.getRegisteredDate());
+    }
+
+    @Test
+    public void setRegisteredDateTest() {
+        String string = GetRandomString();
+        certificate.setRegisteredDate(string);
+        assertEquals(string, certificate.getRegisteredDate());
+    }
+
+
+
+
+
+
+}

+ 40 - 0
src/test/java/scot/carricksoftware/grantswriter/domains/certificates/divorcecertificate/DivorceCertificateIDTest.java

@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 2025.  Andrew Grant Carrick Software. All rights reserved
+ *
+ */
+
+package scot.carricksoftware.grantswriter.domains.certificates.divorcecertificate;
+
+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.GenerateRandomNumberValues.GetRandomLong;
+
+
+class DivorceCertificateIDTest {
+
+    private DivorceCertificate certificate;
+
+    @BeforeEach
+    void setUp() {
+        certificate = new DivorceCertificate();
+    }
+
+    @Test
+    public void getIdTest() {
+        assertNull(certificate.getId());
+    }
+
+    @Test
+    public void setIdTest() {
+        Long id = GetRandomLong();
+        certificate.setId(id);
+        assertEquals(id, certificate.getId());
+    }
+
+
+
+}

+ 54 - 0
src/test/java/scot/carricksoftware/grantswriter/domains/certificates/divorcecertificate/DivorceCertificatePeopleTest.java

@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 2025.  Andrew Grant Carrick Software. All rights reserved
+ *
+ */
+
+package scot.carricksoftware.grantswriter.domains.certificates.divorcecertificate;
+
+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 DivorceCertificatePeopleTest {
+
+    private DivorceCertificate certificate;
+
+    @BeforeEach
+    void setUp() {
+        certificate = new DivorceCertificate();
+    }
+
+    @Test
+    public void getFirstPartyTest() {
+        assertNull(certificate.getFirstParty());
+    }
+
+    @Test
+    public void setFirstPartyTest() {
+        Person person = GetRandomPerson();
+        certificate.setFirstParty(person);
+        assertEquals(person, certificate.getFirstParty());
+    }
+
+    @Test
+    public void getSecondPartyTest() {
+        assertNull(certificate.getSecondParty());
+    }
+
+    @Test
+    public void setSecondPartyTest() {
+        Person person = GetRandomPerson();
+        certificate.setSecondParty(person);
+        assertEquals(person, certificate.getSecondParty());
+    }
+
+
+
+
+}