|
@@ -12,10 +12,16 @@ import scot.carricksoftware.grants.commands.certificates.birthcertificates.Birth
|
|
|
import scot.carricksoftware.grants.commands.certificates.birthcertificates.BirthCertificateCommandImpl;
|
|
import scot.carricksoftware.grants.commands.certificates.birthcertificates.BirthCertificateCommandImpl;
|
|
|
import scot.carricksoftware.grants.domains.certificates.BirthCertificate;
|
|
import scot.carricksoftware.grants.domains.certificates.BirthCertificate;
|
|
|
import scot.carricksoftware.grants.domains.people.Person;
|
|
import scot.carricksoftware.grants.domains.people.Person;
|
|
|
|
|
+import scot.carricksoftware.grants.domains.places.Place;
|
|
|
|
|
+
|
|
|
|
|
+import java.sql.Date;
|
|
|
|
|
|
|
|
import static org.junit.jupiter.api.Assertions.assertEquals;
|
|
import static org.junit.jupiter.api.Assertions.assertEquals;
|
|
|
|
|
+import static scot.carricksoftware.grants.GenerateCertificateRandomValues.GetRandomString;
|
|
|
|
|
+import static scot.carricksoftware.grants.GenerateRandomDateValues.GetRandomDate;
|
|
|
import static scot.carricksoftware.grants.GenerateRandomNumberValues.GetRandomLong;
|
|
import static scot.carricksoftware.grants.GenerateRandomNumberValues.GetRandomLong;
|
|
|
import static scot.carricksoftware.grants.GenerateRandomPeopleValues.GetRandomPerson;
|
|
import static scot.carricksoftware.grants.GenerateRandomPeopleValues.GetRandomPerson;
|
|
|
|
|
+import static scot.carricksoftware.grants.GenerateRandomPlaceValues.GetRandomPlace;
|
|
|
|
|
|
|
|
class BirthCertificateCommandConverterTest {
|
|
class BirthCertificateCommandConverterTest {
|
|
|
|
|
|
|
@@ -31,9 +37,15 @@ class BirthCertificateCommandConverterTest {
|
|
|
Long id = GetRandomLong();
|
|
Long id = GetRandomLong();
|
|
|
Person person = GetRandomPerson();
|
|
Person person = GetRandomPerson();
|
|
|
BirthCertificateCommand source = new BirthCertificateCommandImpl();
|
|
BirthCertificateCommand source = new BirthCertificateCommandImpl();
|
|
|
|
|
+ Place issuedAt = GetRandomPlace();
|
|
|
|
|
+ String certificateNumber = GetRandomString();
|
|
|
|
|
+ Date certificateDate = GetRandomDate();
|
|
|
|
|
|
|
|
source.setId(id);
|
|
source.setId(id);
|
|
|
source.setNewBorn(person);
|
|
source.setNewBorn(person);
|
|
|
|
|
+ source.setCertificateNumber(certificateNumber);
|
|
|
|
|
+ source.setCertificateDate(certificateDate);
|
|
|
|
|
+ source.setCertificateIssuedAt(issuedAt);
|
|
|
|
|
|
|
|
|
|
|
|
|
BirthCertificate target = converter.convert(source);
|
|
BirthCertificate target = converter.convert(source);
|
|
@@ -41,5 +53,9 @@ class BirthCertificateCommandConverterTest {
|
|
|
assert target != null;
|
|
assert target != null;
|
|
|
assertEquals(id, target.getId());
|
|
assertEquals(id, target.getId());
|
|
|
assertEquals(person, target.getNewBorn());
|
|
assertEquals(person, target.getNewBorn());
|
|
|
|
|
+ assertEquals(certificateNumber, target.getCertificateNumber());
|
|
|
|
|
+ assertEquals(certificateDate, target.getCertificateDate());
|
|
|
|
|
+ assertEquals(issuedAt, target.getCertificateIssuedAt());
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|