Browse Source

PersonText converters tests

Andrew Grant 3 months ago
parent
commit
59dd9ee498

+ 15 - 0
src/test/java/scot/carricksoftware/grants/converters/text/persontext/PersonTextCommandConverterTest.java

@@ -14,6 +14,7 @@ import scot.carricksoftware.grants.domains.text.PersonText;
 
 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;
 import static scot.carricksoftware.grants.GenerateRandomPeopleValues.GetRandomPerson;
 
@@ -30,15 +31,29 @@ class PersonTextCommandConverterTest {
     void covertTest() {
         Long Id = GetRandomLong();
         Person person = GetRandomPerson();
+        Long order = GetRandomLong();
+        Long level = GetRandomLong();
+        String heading = GetRandomString();
+        String content = GetRandomString();
+
         PersonTextCommand source = new PersonTextCommandImpl();
 
         source.setId(Id);
         source.setPerson(person);
+        source.setOrder(order);
+        source.setLevel(level);
+        source.setHeading(heading);
+        source.setOrder(order);
+        source.setContent(content);
 
         PersonText target = converter.convert(source);
 
         assertNotNull(target);
         assertEquals(Id, target.getId());
         assertEquals(person, target.getPerson());
+        assertEquals(order, target.getOrder());
+        assertEquals(level, target.getLevel());
+        assertEquals(heading, target.getHeading());
+        assertEquals(content, target.getContent());
     }
 }

+ 14 - 1
src/test/java/scot/carricksoftware/grants/converters/text/persontext/PersonTextConverterTest.java

@@ -13,6 +13,7 @@ import scot.carricksoftware.grants.domains.text.PersonText;
 
 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;
 import static scot.carricksoftware.grants.GenerateRandomPeopleValues.GetRandomPerson;
 
@@ -29,16 +30,28 @@ class PersonTextConverterTest {
     void covertTest() {
         Long Id = GetRandomLong();
         Person person = GetRandomPerson();
-
+        Long order = GetRandomLong();
+        Long level = GetRandomLong();
+        String heading = GetRandomString();
+        String content = GetRandomString();
         PersonText source = new PersonText();
 
         source.setId(Id);
         source.setPerson(person);
+        source.setOrder(order);
+        source.setLevel(level);
+        source.setHeading(heading);
+        source.setOrder(order);
+        source.setContent(content);
 
         PersonTextCommand target = converter.convert(source);
 
         assertNotNull(target);
         assertEquals(Id, target.getId());
         assertEquals(person, target.getPerson());
+        assertEquals(order, target.getOrder());
+        assertEquals(level, target.getLevel());
+        assertEquals(heading, target.getHeading());
+        assertEquals(content, target.getContent());
     }
 }

+ 1 - 0
src/test/java/scot/carricksoftware/grants/converters/text/placeText/PlaceTextCommandConverterTest.java

@@ -32,6 +32,7 @@ class PlaceTextCommandConverterTest {
         Place place = GetRandomPlace();
         PlaceTextCommand source = new PlaceTextCommandImpl();
 
+
         source.setId(Id);
         source.setPlace(place);