浏览代码

DocumentText Converters test

apg 2 周之前
父节点
当前提交
472a2c1808

+ 1 - 1
src/test/java/scot/carricksoftware/grants/converters/text/appendixtext/AppendixBaseTextCommandConverterTest.java → src/test/java/scot/carricksoftware/grants/converters/text/appendixtext/AppendixTextCommandConverterTest.java

@@ -16,7 +16,7 @@ import static org.junit.jupiter.api.Assertions.assertNotNull;
 import static scot.carricksoftware.grants.GenerateCertificateRandomValues.GetRandomString;
 import static scot.carricksoftware.grants.GenerateRandomNumberValues.GetRandomLong;
 
-class AppendixBaseTextCommandConverterTest {
+class AppendixTextCommandConverterTest {
 
     private AppendixTextCommandConverter converter;
 

+ 1 - 1
src/test/java/scot/carricksoftware/grants/converters/text/appendixtext/AppendixBaseTextConverterTest.java → src/test/java/scot/carricksoftware/grants/converters/text/appendixtext/AppendixTextConverterTest.java

@@ -15,7 +15,7 @@ import static org.junit.jupiter.api.Assertions.assertNotNull;
 import static scot.carricksoftware.grants.GenerateCertificateRandomValues.GetRandomString;
 import static scot.carricksoftware.grants.GenerateRandomNumberValues.GetRandomLong;
 
-class AppendixBaseTextConverterTest {
+class AppendixTextConverterTest {
 
     private AppendixTextConverter converter;
 

+ 19 - 2
src/test/java/scot/carricksoftware/grants/converters/text/documenttext/DocumentBaseTextCommandConverterTest.java → src/test/java/scot/carricksoftware/grants/converters/text/documenttext/DocumentTextCommandConverterTest.java

@@ -11,10 +11,13 @@ import scot.carricksoftware.grants.commands.text.DocumentTextCommand;
 import scot.carricksoftware.grants.commands.text.DocumentTextCommandImpl;
 import scot.carricksoftware.grants.domains.text.DocumentText;
 
-import static org.junit.jupiter.api.Assertions.*;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static scot.carricksoftware.grants.GenerateCertificateRandomValues.GetRandomString;
 import static scot.carricksoftware.grants.GenerateRandomNumberValues.GetRandomLong;
 
-class DocumentBaseTextCommandConverterTest {
+class DocumentTextCommandConverterTest {
+
 
     private DocumentTextCommandConverter converter;
 
@@ -26,13 +29,27 @@ class DocumentBaseTextCommandConverterTest {
     @Test
     void covertTest() {
         Long Id = GetRandomLong();
+        String order = GetRandomString();
+        String level = GetRandomString();
+        String heading = GetRandomString();
+        String content = GetRandomString();
+
         DocumentTextCommand source = new DocumentTextCommandImpl();
 
         source.setId(Id);
+        source.setOrder(order);
+        source.setLevel(level);
+        source.setHeading(heading);
+        source.setOrder(order);
+        source.setContent(content);
 
         DocumentText target = converter.convert(source);
 
         assertNotNull(target);
         assertEquals(Id, target.getId());
+        assertEquals(order, target.getOrder());
+        assertEquals(level, target.getLevel());
+        assertEquals(heading, target.getHeading());
+        assertEquals(content, target.getContent());
     }
 }

+ 15 - 2
src/test/java/scot/carricksoftware/grants/converters/text/documenttext/DocumentBaseTextConverterTest.java → src/test/java/scot/carricksoftware/grants/converters/text/documenttext/DocumentTextConverterTest.java

@@ -13,9 +13,10 @@ import scot.carricksoftware.grants.domains.text.DocumentText;
 
 import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static scot.carricksoftware.grants.GenerateCertificateRandomValues.GetRandomString;
 import static scot.carricksoftware.grants.GenerateRandomNumberValues.GetRandomLong;
 
-class DocumentBaseTextConverterTest {
+class DocumentTextConverterTest {
 
     private DocumentTextConverter converter;
 
@@ -27,14 +28,26 @@ class DocumentBaseTextConverterTest {
     @Test
     void covertTest() {
         Long Id = GetRandomLong();
-
+        String order = GetRandomString();
+        String level = GetRandomString();
+        String heading = GetRandomString();
+        String content = GetRandomString();
         DocumentText source = new DocumentText();
 
         source.setId(Id);
+        source.setOrder(order);
+        source.setLevel(level);
+        source.setHeading(heading);
+        source.setOrder(order);
+        source.setContent(content);
 
         DocumentTextCommand target = converter.convert(source);
 
         assertNotNull(target);
         assertEquals(Id, target.getId());
+        assertEquals(order, target.getOrder());
+        assertEquals(level, target.getLevel());
+        assertEquals(heading, target.getHeading());
+        assertEquals(content, target.getContent());
     }
 }