Просмотр исходного кода

MarriageCertificateGroomCommandConverterTest

Andrew Grant 4 месяцев назад
Родитель
Сommit
c7c2a3dd60

+ 64 - 0
src/test/java/scot/carricksoftware/grants/converters/certificates/marriagecertificates/helpers/command/MarriageCertificateBrideCommandConverterTest.java

@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2025.  Andrew Grant Carrick Software. All rights reserved
+ *
+ */
+
+package scot.carricksoftware.grants.converters.certificates.marriagecertificates.helpers.command;
+
+
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import scot.carricksoftware.grants.commands.certificates.marriagecertificates.MarriageCertificateCommand;
+import scot.carricksoftware.grants.commands.certificates.marriagecertificates.MarriageCertificateCommandImpl;
+import scot.carricksoftware.grants.domains.certificates.MarriageCertificate;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static scot.carricksoftware.grants.GenerateCertificateRandomValues.GetRandomString;
+import static scot.carricksoftware.grants.GenerateRandomPeopleValues.GetRandomPerson;
+import static scot.carricksoftware.grants.GenerateRandomPlaceValues.GetRandomPlace;
+
+class MarriageCertificateBrideCommandConverterTest {
+
+    private MarriageCertificateBrideCommandConverter converter;
+   
+    private MarriageCertificateCommand source;
+    private MarriageCertificate target;
+
+    @BeforeEach
+    void setUp() {
+        converter = new MarriageCertificateBrideCommandConverterImpl();
+        source = new MarriageCertificateCommandImpl();
+        target = new MarriageCertificate();
+    }
+
+    @Test
+    void convertTest() {
+        source.setBride(GetRandomPerson());
+        source.setBrideUsualResidence(GetRandomPlace());
+        source.setBrideAge(GetRandomString());
+        source.setBrideCondition(GetRandomString());
+        source.setBrideFather(GetRandomPerson());
+        source.setBrideFatherRank(GetRandomString());
+        source.setBrideRank(GetRandomString());
+        source.setBrideUntrackedFather(GetRandomString());
+        source.setBrideUntrackedResidence(GetRandomString());
+        source.setBrideUsualResidence(GetRandomPlace());
+
+        converter.convert(source, target);
+
+        assertEquals(source.getBride(),target.getBride());
+        assertEquals(source.getBrideUsualResidence(),target.getBrideUsualResidence());
+        assertEquals(source.getBrideAge(),target.getBrideAge());
+        assertEquals(source.getBrideCondition(),target.getBrideCondition());
+        assertEquals(source.getBrideFather(),target.getBrideFather());
+        assertEquals(source.getBrideFatherRank(),target.getBrideFatherRank());
+        assertEquals(source.getBrideRank(),target.getBrideRank());
+        assertEquals(source.getBrideUntrackedFather(),target.getBrideUntrackedFather());
+        assertEquals(source.getBrideUntrackedResidence(),target.getBrideUntrackedResidence());
+        assertEquals(source.getBrideUsualResidence(),target.getBrideUsualResidence());
+        
+  
+
+    }
+
+}

+ 64 - 0
src/test/java/scot/carricksoftware/grants/converters/certificates/marriagecertificates/helpers/command/MarriageCertificateGroomCommandConverterTest.java

@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2025.  Andrew Grant Carrick Software. All rights reserved
+ *
+ */
+
+package scot.carricksoftware.grants.converters.certificates.marriagecertificates.helpers.command;
+
+
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import scot.carricksoftware.grants.commands.certificates.marriagecertificates.MarriageCertificateCommand;
+import scot.carricksoftware.grants.commands.certificates.marriagecertificates.MarriageCertificateCommandImpl;
+import scot.carricksoftware.grants.domains.certificates.MarriageCertificate;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static scot.carricksoftware.grants.GenerateCertificateRandomValues.GetRandomString;
+import static scot.carricksoftware.grants.GenerateRandomPeopleValues.GetRandomPerson;
+import static scot.carricksoftware.grants.GenerateRandomPlaceValues.GetRandomPlace;
+
+class MarriageCertificateGroomCommandConverterTest {
+
+    private MarriageCertificateGroomCommandConverter converter;
+   
+    private MarriageCertificateCommand source;
+    private MarriageCertificate target;
+
+    @BeforeEach
+    void setUp() {
+        converter = new MarriageCertificateGroomCommandConverterImpl();
+        source = new MarriageCertificateCommandImpl();
+        target = new MarriageCertificate();
+    }
+
+    @Test
+    void convertTest() {
+        source.setGroom(GetRandomPerson());
+        source.setGroomUsualResidence(GetRandomPlace());
+        source.setGroomAge(GetRandomString());
+        source.setGroomCondition(GetRandomString());
+        source.setGroomFather(GetRandomPerson());
+        source.setGroomFatherRank(GetRandomString());
+        source.setGroomRank(GetRandomString());
+        source.setGroomUntrackedFather(GetRandomString());
+        source.setGroomUntrackedResidence(GetRandomString());
+        source.setGroomUsualResidence(GetRandomPlace());
+
+        converter.convert(source, target);
+
+        assertEquals(source.getGroom(),target.getGroom());
+        assertEquals(source.getGroomUsualResidence(),target.getGroomUsualResidence());
+        assertEquals(source.getGroomAge(),target.getGroomAge());
+        assertEquals(source.getGroomCondition(),target.getGroomCondition());
+        assertEquals(source.getGroomFather(),target.getGroomFather());
+        assertEquals(source.getGroomFatherRank(),target.getGroomFatherRank());
+        assertEquals(source.getGroomRank(),target.getGroomRank());
+        assertEquals(source.getGroomUntrackedFather(),target.getGroomUntrackedFather());
+        assertEquals(source.getGroomUntrackedResidence(),target.getGroomUntrackedResidence());
+        assertEquals(source.getGroomUsualResidence(),target.getGroomUsualResidence());
+        
+  
+
+    }
+
+}