Quellcode durchsuchen

WhereBorn added to converters Test(1)

Andrew Grant vor 5 Monaten
Ursprung
Commit
91fe849869

+ 8 - 3
src/test/java/scot/carricksoftware/grants/converters/certificates/birthcertificates/BirthCertificateCommandConverterTest.java

@@ -13,6 +13,7 @@ import scot.carricksoftware.grants.commands.certificates.birthcertificates.Birth
 import scot.carricksoftware.grants.domains.certificates.BirthCertificate;
 import scot.carricksoftware.grants.domains.people.Person;
 import scot.carricksoftware.grants.domains.places.Organisation;
+import scot.carricksoftware.grants.domains.places.Place;
 import scot.carricksoftware.grants.enums.general.Sex;
 import scot.carricksoftware.grants.enums.certificates.CertificateType;
 
@@ -21,6 +22,7 @@ import static scot.carricksoftware.grants.GenerateCertificateRandomValues.GetRan
 import static scot.carricksoftware.grants.GenerateRandomNumberValues.GetRandomLong;
 import static scot.carricksoftware.grants.GenerateRandomPeopleValues.GetRandomPerson;
 import static scot.carricksoftware.grants.GenerateRandomPlaceValues.GetRandomOrganisation;
+import static scot.carricksoftware.grants.GenerateRandomPlaceValues.GetRandomPlace;
 
 class BirthCertificateCommandConverterTest {
 
@@ -33,7 +35,9 @@ class BirthCertificateCommandConverterTest {
 
     @Test
     void convertTest() {
+        String untrackedWhereBorn = GetRandomString();
         Long id = GetRandomLong();
+        Place whereBorn = GetRandomPlace();
         Person person = GetRandomPerson();
         BirthCertificateCommand source = new BirthCertificateCommandImpl();
         Organisation issuedAt = GetRandomOrganisation();
@@ -45,7 +49,6 @@ class BirthCertificateCommandConverterTest {
         String number = GetRandomString();
         Sex sex = Sex.MALE;
         String whenBorn = GetRandomString();
-        String whereBorn = GetRandomString();
         Person father = GetRandomPerson();
         Person mother = GetRandomPerson();
         String dateAndPlaceOfMarriage = GetRandomString();
@@ -64,7 +67,8 @@ class BirthCertificateCommandConverterTest {
         source.setRegistrationAuthority(registrationAuthority);
         source.setSex(sex);
         source.setWhenBorn(whenBorn);
-        source.setUntrackedWhereBorn(whereBorn);
+        source.setWhereBorn(whereBorn);
+        source.setUntrackedWhereBorn(untrackedWhereBorn);
         source.setFather(father);
         source.setMother(mother);
         source.setDateAndPlaceOfMarriage(dateAndPlaceOfMarriage);
@@ -85,7 +89,8 @@ class BirthCertificateCommandConverterTest {
         assertEquals(number, target.getNumber());
         assertEquals(registrationAuthority, target.getRegistrationAuthority());
         assertEquals(sex, target.getSex());
-        assertEquals(whereBorn, target.getUntrackedWhereBorn());
+        assertEquals(whereBorn, target.getWhereBorn());
+        assertEquals(untrackedWhereBorn, target.getUntrackedWhereBorn());
         assertEquals(whenBorn, target.getWhenBorn());
         assertEquals(dateAndPlaceOfMarriage, target.getDateAndPlaceOfMarriage());
         assertEquals(fatherRank, target.getFatherRank());