Browse Source

GetRandomDMY in tests

Andrew Grant 1 month ago
parent
commit
43308888d2

+ 2 - 2
src/test/java/scot/carricksoftware/grantswriter/writer/latex/parts/people/subsections/helpers/level2/marriagecertificates/GatherMarriageCertificateBrideTimeLineDataAddRankTest.java

@@ -13,7 +13,6 @@ import org.mockito.junit.jupiter.MockitoExtension;
 import scot.carricksoftware.grantswriter.constants.ApplicationConstants;
 import scot.carricksoftware.grantswriter.converters.StringToDMYConverter;
 import scot.carricksoftware.grantswriter.data.DMY;
-import scot.carricksoftware.grantswriter.data.DMYImpl;
 import scot.carricksoftware.grantswriter.data.TimeLineData;
 import scot.carricksoftware.grantswriter.domains.certificates.marriagecertificate.MarriageCertificate;
 import scot.carricksoftware.grantswriter.domains.people.Person;
@@ -29,6 +28,7 @@ import static org.mockito.ArgumentMatchers.anyString;
 import static org.mockito.Mockito.when;
 import static org.testng.Assert.assertTrue;
 import static scot.carricksoftware.grantswriter.GenerateCertificateRandomValues.GetRandomString;
+import static scot.carricksoftware.grantswriter.GenerateRandomDMYValues.GetRandomDMY;
 import static scot.carricksoftware.grantswriter.GenerateRandomPeopleValues.GetRandomPerson;
 
 @ExtendWith(MockitoExtension.class)
@@ -67,7 +67,7 @@ class GatherMarriageCertificateBrideTimeLineDataAddRankTest {
         bride = GetRandomPerson();
         groom = GetRandomPerson();
         rank = GetRandomString();
-        DMY dmy = new DMYImpl();
+        DMY dmy = GetRandomDMY();
         dmy.parse("25/01/1953");
         when(stringToDMYConverterMock.convert(anyString())).thenReturn(dmy);
 

+ 2 - 3
src/test/java/scot/carricksoftware/grantswriter/writer/latex/parts/people/subsections/helpers/level2/marriagecertificates/GatherMarriageCertificateBrideTimeLineDataRefsTest.java

@@ -12,7 +12,6 @@ import org.mockito.Mock;
 import org.mockito.junit.jupiter.MockitoExtension;
 import scot.carricksoftware.grantswriter.converters.StringToDMYConverter;
 import scot.carricksoftware.grantswriter.data.DMY;
-import scot.carricksoftware.grantswriter.data.DMYImpl;
 import scot.carricksoftware.grantswriter.data.TimeLineData;
 import scot.carricksoftware.grantswriter.domains.certificates.marriagecertificate.MarriageCertificate;
 import scot.carricksoftware.grantswriter.domains.people.Person;
@@ -28,6 +27,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
 import static org.mockito.ArgumentMatchers.anyString;
 import static org.mockito.Mockito.when;
 import static scot.carricksoftware.grantswriter.GenerateCertificateRandomValues.GetRandomString;
+import static scot.carricksoftware.grantswriter.GenerateRandomDMYValues.GetRandomDMY;
 import static scot.carricksoftware.grantswriter.GenerateRandomPeopleValues.GetRandomPerson;
 
 @ExtendWith(MockitoExtension.class)
@@ -54,8 +54,7 @@ class GatherMarriageCertificateBrideTimeLineDataRefsTest {
         marriageCertificates = new ArrayList<>();
         bride = GetRandomPerson();
         groom = GetRandomPerson();
-        DMY dmy = new DMYImpl();
-        dmy.parse("25/01/1953");
+        DMY dmy = GetRandomDMY();
         when(stringToDMYConverterMock.convert(anyString())).thenReturn(dmy);
     }
 

+ 2 - 3
src/test/java/scot/carricksoftware/grantswriter/writer/latex/parts/people/subsections/helpers/level2/marriagecertificates/GatherMarriageCertificateBrideTimeLineDataWhenMarriedTest.java

@@ -12,7 +12,6 @@ import org.mockito.Mock;
 import org.mockito.junit.jupiter.MockitoExtension;
 import scot.carricksoftware.grantswriter.converters.StringToDMYConverter;
 import scot.carricksoftware.grantswriter.data.DMY;
-import scot.carricksoftware.grantswriter.data.DMYImpl;
 import scot.carricksoftware.grantswriter.data.TimeLineData;
 import scot.carricksoftware.grantswriter.domains.certificates.marriagecertificate.MarriageCertificate;
 import scot.carricksoftware.grantswriter.domains.people.Person;
@@ -28,6 +27,7 @@ import static org.mockito.ArgumentMatchers.anyString;
 import static org.mockito.Mockito.when;
 import static org.testng.Assert.assertTrue;
 import static scot.carricksoftware.grantswriter.GenerateCertificateRandomValues.GetRandomString;
+import static scot.carricksoftware.grantswriter.GenerateRandomDMYValues.GetRandomDMY;
 import static scot.carricksoftware.grantswriter.GenerateRandomPeopleValues.GetRandomPerson;
 import static scot.carricksoftware.grantswriter.GenerateRandomPlaceValues.GetRandomPlace;
 
@@ -62,8 +62,7 @@ class GatherMarriageCertificateBrideTimeLineDataWhenMarriedTest {
         gatherMarriageCertificateBrideTimeLineData = new GatherMarriageCertificateBrideTimeLineDataImpl(
                 this.timelineDataMock,
                 stringToDMYConverterMock);
-        DMY dmy = new DMYImpl();
-        dmy.parse("25/01/1953");
+        DMY dmy = GetRandomDMY();
         when(stringToDMYConverterMock.convert(anyString())).thenReturn(dmy);
         marriageCertificates = new ArrayList<>();
 

+ 2 - 3
src/test/java/scot/carricksoftware/grantswriter/writer/latex/parts/people/subsections/helpers/level2/marriagecertificates/GatherMarriageCertificateGroomTimeLineDataAddRankTest.java

@@ -13,7 +13,6 @@ import org.mockito.junit.jupiter.MockitoExtension;
 import scot.carricksoftware.grantswriter.constants.ApplicationConstants;
 import scot.carricksoftware.grantswriter.converters.StringToDMYConverter;
 import scot.carricksoftware.grantswriter.data.DMY;
-import scot.carricksoftware.grantswriter.data.DMYImpl;
 import scot.carricksoftware.grantswriter.data.TimeLineData;
 import scot.carricksoftware.grantswriter.domains.certificates.marriagecertificate.MarriageCertificate;
 import scot.carricksoftware.grantswriter.domains.people.Person;
@@ -29,6 +28,7 @@ import static org.mockito.ArgumentMatchers.anyString;
 import static org.mockito.Mockito.when;
 import static org.testng.Assert.assertTrue;
 import static scot.carricksoftware.grantswriter.GenerateCertificateRandomValues.GetRandomString;
+import static scot.carricksoftware.grantswriter.GenerateRandomDMYValues.GetRandomDMY;
 import static scot.carricksoftware.grantswriter.GenerateRandomPeopleValues.GetRandomPerson;
 
 @ExtendWith(MockitoExtension.class)
@@ -67,8 +67,7 @@ class GatherMarriageCertificateGroomTimeLineDataAddRankTest {
         bride = GetRandomPerson();
         groom = GetRandomPerson();
         rank = GetRandomString();
-        DMY dmy = new DMYImpl();
-        dmy.parse("25/01/1953");
+        DMY dmy = GetRandomDMY();
         when(stringToDMYConverterMock.convert(anyString())).thenReturn(dmy);
     }
 

+ 2 - 3
src/test/java/scot/carricksoftware/grantswriter/writer/latex/parts/people/subsections/helpers/level2/marriagecertificates/GatherMarriageCertificateGroomTimeLineDataRefsTest.java

@@ -12,7 +12,6 @@ import org.mockito.Mock;
 import org.mockito.junit.jupiter.MockitoExtension;
 import scot.carricksoftware.grantswriter.converters.StringToDMYConverter;
 import scot.carricksoftware.grantswriter.data.DMY;
-import scot.carricksoftware.grantswriter.data.DMYImpl;
 import scot.carricksoftware.grantswriter.data.TimeLineData;
 import scot.carricksoftware.grantswriter.domains.certificates.marriagecertificate.MarriageCertificate;
 import scot.carricksoftware.grantswriter.domains.people.Person;
@@ -28,6 +27,7 @@ import java.util.TreeSet;
 import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.mockito.ArgumentMatchers.anyString;
 import static org.mockito.Mockito.when;
+import static scot.carricksoftware.grantswriter.GenerateRandomDMYValues.GetRandomDMY;
 import static scot.carricksoftware.grantswriter.GenerateRandomPeopleValues.GetRandomPerson;
 
 @ExtendWith(MockitoExtension.class)
@@ -54,8 +54,7 @@ class GatherMarriageCertificateGroomTimeLineDataRefsTest {
         marriageCertificates = new ArrayList<>();
         groom = GetRandomPerson();
         bride = GetRandomPerson();
-        DMY dmy = new DMYImpl();
-        dmy.parse("25/01/1953");
+        DMY dmy = GetRandomDMY();
         when(stringToDMYConverterMock.convert(anyString())).thenReturn(dmy);
     }
 

+ 2 - 3
src/test/java/scot/carricksoftware/grantswriter/writer/latex/parts/people/subsections/helpers/level2/marriagecertificates/GatherMarriageCertificateGroomTimeLineDataWhenMarriedTest.java

@@ -12,7 +12,6 @@ import org.mockito.Mock;
 import org.mockito.junit.jupiter.MockitoExtension;
 import scot.carricksoftware.grantswriter.converters.StringToDMYConverter;
 import scot.carricksoftware.grantswriter.data.DMY;
-import scot.carricksoftware.grantswriter.data.DMYImpl;
 import scot.carricksoftware.grantswriter.data.TimeLineData;
 import scot.carricksoftware.grantswriter.domains.certificates.marriagecertificate.MarriageCertificate;
 import scot.carricksoftware.grantswriter.domains.people.Person;
@@ -28,6 +27,7 @@ import static org.mockito.ArgumentMatchers.anyString;
 import static org.mockito.Mockito.when;
 import static org.testng.Assert.assertTrue;
 import static scot.carricksoftware.grantswriter.GenerateCertificateRandomValues.GetRandomString;
+import static scot.carricksoftware.grantswriter.GenerateRandomDMYValues.GetRandomDMY;
 import static scot.carricksoftware.grantswriter.GenerateRandomPeopleValues.GetRandomPerson;
 import static scot.carricksoftware.grantswriter.GenerateRandomPlaceValues.GetRandomPlace;
 
@@ -71,8 +71,7 @@ class GatherMarriageCertificateGroomTimeLineDataWhenMarriedTest {
         whereMarried = GetRandomPlace();
         untrackedPlace = GetRandomString();
         setUpBaseCertificate();
-        DMY dmy = new DMYImpl();
-        dmy.parse("25/01/1953");
+        DMY dmy = GetRandomDMY();
         when(stringToDMYConverterMock.convert(anyString())).thenReturn(dmy);
     }