Pārlūkot izejas kodu

CensusEntry age and where born added to converters

Andrew Grant 5 mēneši atpakaļ
vecāks
revīzija
4d793b4acb

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

@@ -24,6 +24,8 @@ public class CensusEntryCommandConverterImpl implements CensusEntryCommandConver
         result.setCondition(source.getCondition());
         result.setGaelic(source.getGaelic());
         result.setWorker(source.getWorker());
+        result.setAge(source.getAge());
+        result.setWhereBorn(source.getWhereBorn());
         return result;
     }
 

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

@@ -25,6 +25,8 @@ public class CensusEntryConverterImpl implements CensusEntryConverter {
         result.setCondition(source.getCondition());
         result.setGaelic(source.getGaelic());
         result.setWorker(source.getWorker());
+        result.setAge(source.getAge());
+        result.setWhereBorn(source.getWhereBorn());
         return result;
     }
 }

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

@@ -44,6 +44,8 @@ class CensusEntryCommandConverterTest {
         CensusEntryCommand source = new CensusEntryCommandImpl();
         Census census = GetRandomCensus();
         Person person = GetRandomPerson();
+        String age = GetRandomString();
+        String whereBorn = GetRandomString();
 
 
         source.setId(id);
@@ -54,6 +56,8 @@ class CensusEntryCommandConverterTest {
         source.setCondition(condition);
         source.setGaelic(gaelic);
         source.setWorker(worker);
+        source.setAge(age);
+        source.setWhereBorn(whereBorn);
 
         CensusEntry target = converter.convert(source);
 
@@ -66,5 +70,7 @@ class CensusEntryCommandConverterTest {
         assertEquals(condition, target.getCondition());
         assertEquals(gaelic, target.getGaelic());
         assertEquals(worker, target.getWorker());
+        assertEquals(age, target.getAge());
+        assertEquals(whereBorn, target.getWhereBorn());
     }
 }

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

@@ -43,6 +43,8 @@ class CensusEntryConverterTest {
         CensusEntryGaelic gaelic = GetRandomCensusEntryGaelic();
         CensusEntryWorker worker = GetRandomCensusEntryWorker();
         Person person = GetRandomPerson();
+        String age = GetRandomString();
+        String whereBorn = GetRandomString();
 
         source.setId(id);
         source.setName(name);
@@ -52,6 +54,8 @@ class CensusEntryConverterTest {
         source.setCondition(condition);
         source.setGaelic(gaelic);
         source.setWorker(worker);
+        source.setAge(age);
+        source.setWhereBorn(whereBorn);
 
         CensusEntryCommand target = converter.convert(source);
 
@@ -64,5 +68,7 @@ class CensusEntryConverterTest {
         assertEquals(condition, target.getCondition());
         assertEquals(gaelic, target.getGaelic());
         assertEquals(worker, target.getWorker());
+        assertEquals(age, target.getAge());
+        assertEquals(whereBorn, target.getWhereBorn());
     }
 }