ソースを参照

CensusEntry Sex Enum in converters

Andrew Grant 7 ヶ月 前
コミット
e4940e689c

+ 1 - 0
src/main/java/scot/carricksoftware/grants/converters/census/CensusEntryCommandConverterImpl.java

@@ -26,6 +26,7 @@ public class CensusEntryCommandConverterImpl implements CensusEntryCommandConver
         result.setWorker(source.getWorker());
         result.setAge(source.getAge());
         result.setWhereBorn(source.getWhereBorn());
+        result.setSex(source.getSex());
         return result;
     }
 

+ 1 - 0
src/main/java/scot/carricksoftware/grants/converters/census/CensusEntryConverterImpl.java

@@ -27,6 +27,7 @@ public class CensusEntryConverterImpl implements CensusEntryConverter {
         result.setWorker(source.getWorker());
         result.setAge(source.getAge());
         result.setWhereBorn(source.getWhereBorn());
+        result.setSex(source.getSex());
         return result;
     }
 }

+ 4 - 4
src/test/java/scot/carricksoftware/grants/converters/census/CensusEntryCommandConverterTest.java

@@ -12,10 +12,7 @@ import scot.carricksoftware.grants.commands.census.CensusEntryCommandImpl;
 import scot.carricksoftware.grants.domains.census.Census;
 import scot.carricksoftware.grants.domains.census.CensusEntry;
 import scot.carricksoftware.grants.domains.people.Person;
-import scot.carricksoftware.grants.enums.censusentry.CensusEntryCondition;
-import scot.carricksoftware.grants.enums.censusentry.CensusEntryGaelic;
-import scot.carricksoftware.grants.enums.censusentry.CensusEntryRelationship;
-import scot.carricksoftware.grants.enums.censusentry.CensusEntryWorker;
+import scot.carricksoftware.grants.enums.censusentry.*;
 
 import static org.junit.jupiter.api.Assertions.assertEquals;
 import static scot.carricksoftware.grants.GenerateCensusEntryRandomEnums.*;
@@ -46,6 +43,7 @@ class CensusEntryCommandConverterTest {
         Person person = GetRandomPerson();
         String age = GetRandomString();
         String whereBorn = GetRandomString();
+        CensusEntrySex sex = GetRandomCensusEntrySex();
 
 
         source.setId(id);
@@ -58,6 +56,7 @@ class CensusEntryCommandConverterTest {
         source.setWorker(worker);
         source.setAge(age);
         source.setWhereBorn(whereBorn);
+        source.setSex(sex);
 
         CensusEntry target = converter.convert(source);
 
@@ -72,5 +71,6 @@ class CensusEntryCommandConverterTest {
         assertEquals(worker, target.getWorker());
         assertEquals(age, target.getAge());
         assertEquals(whereBorn, target.getWhereBorn());
+        assertEquals(sex, target.getSex());
     }
 }

+ 4 - 4
src/test/java/scot/carricksoftware/grants/converters/census/CensusEntryConverterTest.java

@@ -11,10 +11,7 @@ import scot.carricksoftware.grants.commands.census.CensusEntryCommand;
 import scot.carricksoftware.grants.domains.census.Census;
 import scot.carricksoftware.grants.domains.census.CensusEntry;
 import scot.carricksoftware.grants.domains.people.Person;
-import scot.carricksoftware.grants.enums.censusentry.CensusEntryGaelic;
-import scot.carricksoftware.grants.enums.censusentry.CensusEntryRelationship;
-import scot.carricksoftware.grants.enums.censusentry.CensusEntryCondition;
-import scot.carricksoftware.grants.enums.censusentry.CensusEntryWorker;
+import scot.carricksoftware.grants.enums.censusentry.*;
 
 import static org.junit.jupiter.api.Assertions.assertEquals;
 import static scot.carricksoftware.grants.GenerateCensusEntryRandomEnums.*;
@@ -45,6 +42,7 @@ class CensusEntryConverterTest {
         Person person = GetRandomPerson();
         String age = GetRandomString();
         String whereBorn = GetRandomString();
+        CensusEntrySex sex = GetRandomCensusEntrySex();
 
         source.setId(id);
         source.setName(name);
@@ -56,6 +54,7 @@ class CensusEntryConverterTest {
         source.setWorker(worker);
         source.setAge(age);
         source.setWhereBorn(whereBorn);
+        source.setSex(sex);
 
         CensusEntryCommand target = converter.convert(source);
 
@@ -70,5 +69,6 @@ class CensusEntryConverterTest {
         assertEquals(worker, target.getWorker());
         assertEquals(age, target.getAge());
         assertEquals(whereBorn, target.getWhereBorn());
+        assertEquals(sex, target.getSex());
     }
 }