소스 검색

MarriageCertificateCertificateCommandConverterTest

Andrew Grant 4 달 전
부모
커밋
b28b757777

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

@@ -0,0 +1,56 @@
+/*
+ * 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.GenerateRandomNumberValues.GetRandomLong;
+import static scot.carricksoftware.grants.GenerateRandomPlaceValues.GetRandomOrganisation;
+import static scot.carricksoftware.grants.GenerateRandomPlaceValues.GetRandomPlace;
+
+class MarriageCertificateCertificateCommandConverterTest {
+
+    private MarriageCertificateCertificateCommandConverter converter;
+   
+    private MarriageCertificateCommand source;
+    private MarriageCertificate target;
+
+    @BeforeEach
+    void setUp() {
+        converter = new MarriageCertificateCertificateCommandConverterImpl();
+        source = new MarriageCertificateCommandImpl();
+        target = new MarriageCertificate();
+    }
+
+    @Test
+    void convertTest() {
+        source.setId(GetRandomLong());
+        source.setNumber(GetRandomString());
+        source.setRegistrationAuthority(GetRandomOrganisation());
+        source.setUntrackedWhereMarried(GetRandomString());
+        source.setVolume(GetRandomString());
+        source.setWhenMarried(GetRandomString());
+        source.setWhereMarried(GetRandomPlace());
+
+        converter.convert(source, target);
+
+        assertEquals(source.getId(),target.getId());
+        assertEquals(source.getNumber(),target.getNumber());
+        assertEquals(source.getRegistrationAuthority(),target.getRegistrationAuthority());
+        assertEquals(source.getUntrackedWhereMarried(),target.getUntrackedWhereMarried());
+        assertEquals(source.getVolume(),target.getVolume());
+        assertEquals(source.getWhenMarried(),target.getWhenMarried());
+        assertEquals(source.getWhereMarried(),target.getWhereMarried());
+    }
+
+}