PregnancyEntitlementCalculatorTest

26

tests

0

failures

0

ignored

0.005s

duration

100%

successful

Tests

Test Method name Duration Result
shouldReturnClaimantIsNotPregnantInCycleForNullDueDate() shouldReturnClaimantIsNotPregnantInCycleForNullDueDate() 0s passed
shouldReturnFalseForDueDateMoreThanGracePeriodWeeksAgo() shouldReturnFalseForDueDateMoreThanGracePeriodWeeksAgo() 0s passed
shouldReturnFalseForNullDueDate() shouldReturnFalseForNullDueDate() 0s passed
[1] PaymentCycle(super=VersionedEntity(super=BaseEntity(id=97868726-1930-4c44-a6b1-a71a91ff6443), versionNumber=null), cycleStartDate=2020-02-07, cycleEndDate=2020-03-06, eligibilityStatus=ELIGIBLE, identityAndEligibilityResponse=CombinedIdentityAndEligibilityResponse(identityStatus=MATCHED, eligibilityStatus=CONFIRMED, deathVerificationFlag=N_A, mobilePhoneMatch=MATCHED, emailAddressMatch=MATCHED, addressLine1Match=MATCHED, postcodeMatch=MATCHED, pregnantChildDOBMatch=NOT_SUPPLIED, dwpHouseholdIdentifier=dwpHousehold1, hmrcHouseholdIdentifier=hmrcHousehold1, dobOfChildrenUnder4=[2019-09-06, 2016-09-06], qualifyingReason=UNIVERSAL_CREDIT), voucherEntitlement=PaymentCycleVoucherEntitlement(vouchersForChildrenUnderOne=8, vouchersForChildrenBetweenOneAndFour=4, vouchersForPregnancy=4, totalVoucherEntitlement=16, singleVoucherValueInPence=310, totalVoucherValueInPence=4960, backdatedVouchers=0, voucherEntitlements=[VoucherEntitlement(vouchersForChildrenUnderOne=2, vouchersForChildrenBetweenOneAndFour=1, vouchersForPregnancy=1, totalVoucherEntitlement=4, singleVoucherValueInPence=310, totalVoucherValueInPence=1240, entitlementDate=2020-02-07), VoucherEntitlement(vouchersForChildrenUnderOne=2, vouchersForChildrenBetweenOneAndFour=1, vouchersForPregnancy=1, totalVoucherEntitlement=4, singleVoucherValueInPence=310, totalVoucherValueInPence=1240, entitlementDate=2020-02-14), VoucherEntitlement(vouchersForChildrenUnderOne=2, vouchersForChildrenBetweenOneAndFour=1, vouchersForPregnancy=1, totalVoucherEntitlement=4, singleVoucherValueInPence=310, totalVoucherValueInPence=1240, entitlementDate=2020-02-21), VoucherEntitlement(vouchersForChildrenUnderOne=2, vouchersForChildrenBetweenOneAndFour=1, vouchersForPregnancy=1, totalVoucherEntitlement=4, singleVoucherValueInPence=310, totalVoucherValueInPence=1240, entitlementDate=2020-02-28)]), expectedDeliveryDate=null, totalVouchers=16, totalEntitlementAmountInPence=4960, cardBalanceInPence=null, cardBalanceTimestamp=null, paymentCycleStatus=NEW) shouldReturnFalseWhenClaimantIsNotPregnantAfterPaymentCycle(PaymentCycle)[1] 0s passed
[2] PaymentCycle(super=VersionedEntity(super=BaseEntity(id=f8fff3b0-ecbf-4818-9f79-ee40b2c91595), versionNumber=null), cycleStartDate=2020-02-07, cycleEndDate=2020-03-06, eligibilityStatus=ELIGIBLE, identityAndEligibilityResponse=CombinedIdentityAndEligibilityResponse(identityStatus=MATCHED, eligibilityStatus=CONFIRMED, deathVerificationFlag=N_A, mobilePhoneMatch=MATCHED, emailAddressMatch=MATCHED, addressLine1Match=MATCHED, postcodeMatch=MATCHED, pregnantChildDOBMatch=NOT_SUPPLIED, dwpHouseholdIdentifier=dwpHousehold1, hmrcHouseholdIdentifier=hmrcHousehold1, dobOfChildrenUnder4=[2019-09-06, 2016-09-06], qualifyingReason=UNIVERSAL_CREDIT), voucherEntitlement=PaymentCycleVoucherEntitlement(vouchersForChildrenUnderOne=8, vouchersForChildrenBetweenOneAndFour=4, vouchersForPregnancy=4, totalVoucherEntitlement=16, singleVoucherValueInPence=310, totalVoucherValueInPence=4960, backdatedVouchers=0, voucherEntitlements=[VoucherEntitlement(vouchersForChildrenUnderOne=2, vouchersForChildrenBetweenOneAndFour=1, vouchersForPregnancy=1, totalVoucherEntitlement=4, singleVoucherValueInPence=310, totalVoucherValueInPence=1240, entitlementDate=2020-02-07), VoucherEntitlement(vouchersForChildrenUnderOne=2, vouchersForChildrenBetweenOneAndFour=1, vouchersForPregnancy=1, totalVoucherEntitlement=4, singleVoucherValueInPence=310, totalVoucherValueInPence=1240, entitlementDate=2020-02-14), VoucherEntitlement(vouchersForChildrenUnderOne=2, vouchersForChildrenBetweenOneAndFour=1, vouchersForPregnancy=1, totalVoucherEntitlement=4, singleVoucherValueInPence=310, totalVoucherValueInPence=1240, entitlementDate=2020-02-21), VoucherEntitlement(vouchersForChildrenUnderOne=2, vouchersForChildrenBetweenOneAndFour=1, vouchersForPregnancy=1, totalVoucherEntitlement=4, singleVoucherValueInPence=310, totalVoucherValueInPence=1240, entitlementDate=2020-02-28)]), expectedDeliveryDate=2019-12-13, totalVouchers=16, totalEntitlementAmountInPence=4960, cardBalanceInPence=null, cardBalanceTimestamp=null, paymentCycleStatus=NEW) shouldReturnFalseWhenClaimantIsNotPregnantAfterPaymentCycle(PaymentCycle)[2] 0s passed
[1] 2020-02-14 shouldReturnFalseWhenPaymentCycleIsNotSecondToLastOneWithPregnancyVouchers(LocalDate)[1] 0.001s passed
[2] 2020-04-24 shouldReturnFalseWhenPaymentCycleIsNotSecondToLastOneWithPregnancyVouchers(LocalDate)[2] 0s passed
[3] 2020-06-26 shouldReturnFalseWhenPaymentCycleIsNotSecondToLastOneWithPregnancyVouchers(LocalDate)[3] 0s passed
[4] 2019-11-15 shouldReturnFalseWhenPaymentCycleIsNotSecondToLastOneWithPregnancyVouchers(LocalDate)[4] 0s passed
[1] 2020-03-06, 2020-03-13 shouldReturnTrueWhenClaimantIsEntitledToVoucher(LocalDate, LocalDate)[1] 0s passed
[2] 2020-03-06, 2020-03-06 shouldReturnTrueWhenClaimantIsEntitledToVoucher(LocalDate, LocalDate)[2] 0s passed
[3] 2020-03-06, 2020-02-28 shouldReturnTrueWhenClaimantIsEntitledToVoucher(LocalDate, LocalDate)[3] 0.001s passed
[4] 2020-03-06, 2019-12-13 shouldReturnTrueWhenClaimantIsEntitledToVoucher(LocalDate, LocalDate)[4] 0s passed
[1] PaymentCycle(super=VersionedEntity(super=BaseEntity(id=db633192-8acf-4fd8-af5f-ef632d3af768), versionNumber=null), cycleStartDate=2020-02-07, cycleEndDate=2020-03-06, eligibilityStatus=ELIGIBLE, identityAndEligibilityResponse=CombinedIdentityAndEligibilityResponse(identityStatus=MATCHED, eligibilityStatus=CONFIRMED, deathVerificationFlag=N_A, mobilePhoneMatch=MATCHED, emailAddressMatch=MATCHED, addressLine1Match=MATCHED, postcodeMatch=MATCHED, pregnantChildDOBMatch=NOT_SUPPLIED, dwpHouseholdIdentifier=dwpHousehold1, hmrcHouseholdIdentifier=hmrcHousehold1, dobOfChildrenUnder4=[2019-09-06, 2016-09-06], qualifyingReason=UNIVERSAL_CREDIT), voucherEntitlement=PaymentCycleVoucherEntitlement(vouchersForChildrenUnderOne=8, vouchersForChildrenBetweenOneAndFour=4, vouchersForPregnancy=4, totalVoucherEntitlement=16, singleVoucherValueInPence=310, totalVoucherValueInPence=4960, backdatedVouchers=0, voucherEntitlements=[VoucherEntitlement(vouchersForChildrenUnderOne=2, vouchersForChildrenBetweenOneAndFour=1, vouchersForPregnancy=1, totalVoucherEntitlement=4, singleVoucherValueInPence=310, totalVoucherValueInPence=1240, entitlementDate=2020-02-07), VoucherEntitlement(vouchersForChildrenUnderOne=2, vouchersForChildrenBetweenOneAndFour=1, vouchersForPregnancy=1, totalVoucherEntitlement=4, singleVoucherValueInPence=310, totalVoucherValueInPence=1240, entitlementDate=2020-02-14), VoucherEntitlement(vouchersForChildrenUnderOne=2, vouchersForChildrenBetweenOneAndFour=1, vouchersForPregnancy=1, totalVoucherEntitlement=4, singleVoucherValueInPence=310, totalVoucherValueInPence=1240, entitlementDate=2020-02-21), VoucherEntitlement(vouchersForChildrenUnderOne=2, vouchersForChildrenBetweenOneAndFour=1, vouchersForPregnancy=1, totalVoucherEntitlement=4, singleVoucherValueInPence=310, totalVoucherValueInPence=1240, entitlementDate=2020-02-28)]), expectedDeliveryDate=2020-03-06, totalVouchers=16, totalEntitlementAmountInPence=4960, cardBalanceInPence=null, cardBalanceTimestamp=null, paymentCycleStatus=NEW) shouldReturnTrueWhenClaimantIsPregnantAfterPaymentCycle(PaymentCycle)[1] 0s passed
[2] PaymentCycle(super=VersionedEntity(super=BaseEntity(id=a31acf53-56b6-4080-8213-f9a818c7c955), versionNumber=null), cycleStartDate=2020-02-07, cycleEndDate=2020-03-06, eligibilityStatus=ELIGIBLE, identityAndEligibilityResponse=CombinedIdentityAndEligibilityResponse(identityStatus=MATCHED, eligibilityStatus=CONFIRMED, deathVerificationFlag=N_A, mobilePhoneMatch=MATCHED, emailAddressMatch=MATCHED, addressLine1Match=MATCHED, postcodeMatch=MATCHED, pregnantChildDOBMatch=NOT_SUPPLIED, dwpHouseholdIdentifier=dwpHousehold1, hmrcHouseholdIdentifier=hmrcHousehold1, dobOfChildrenUnder4=[2019-09-06, 2016-09-06], qualifyingReason=UNIVERSAL_CREDIT), voucherEntitlement=PaymentCycleVoucherEntitlement(vouchersForChildrenUnderOne=8, vouchersForChildrenBetweenOneAndFour=4, vouchersForPregnancy=4, totalVoucherEntitlement=16, singleVoucherValueInPence=310, totalVoucherValueInPence=4960, backdatedVouchers=0, voucherEntitlements=[VoucherEntitlement(vouchersForChildrenUnderOne=2, vouchersForChildrenBetweenOneAndFour=1, vouchersForPregnancy=1, totalVoucherEntitlement=4, singleVoucherValueInPence=310, totalVoucherValueInPence=1240, entitlementDate=2020-02-07), VoucherEntitlement(vouchersForChildrenUnderOne=2, vouchersForChildrenBetweenOneAndFour=1, vouchersForPregnancy=1, totalVoucherEntitlement=4, singleVoucherValueInPence=310, totalVoucherValueInPence=1240, entitlementDate=2020-02-14), VoucherEntitlement(vouchersForChildrenUnderOne=2, vouchersForChildrenBetweenOneAndFour=1, vouchersForPregnancy=1, totalVoucherEntitlement=4, singleVoucherValueInPence=310, totalVoucherValueInPence=1240, entitlementDate=2020-02-21), VoucherEntitlement(vouchersForChildrenUnderOne=2, vouchersForChildrenBetweenOneAndFour=1, vouchersForPregnancy=1, totalVoucherEntitlement=4, singleVoucherValueInPence=310, totalVoucherValueInPence=1240, entitlementDate=2020-02-28)]), expectedDeliveryDate=2019-12-14, totalVouchers=16, totalEntitlementAmountInPence=4960, cardBalanceInPence=null, cardBalanceTimestamp=null, paymentCycleStatus=NEW) shouldReturnTrueWhenClaimantIsPregnantAfterPaymentCycle(PaymentCycle)[2] 0s passed
[3] PaymentCycle(super=VersionedEntity(super=BaseEntity(id=8dc48f6a-355f-40ec-aafa-ff822049c5ac), versionNumber=null), cycleStartDate=2020-02-07, cycleEndDate=2020-03-06, eligibilityStatus=ELIGIBLE, identityAndEligibilityResponse=CombinedIdentityAndEligibilityResponse(identityStatus=MATCHED, eligibilityStatus=CONFIRMED, deathVerificationFlag=N_A, mobilePhoneMatch=MATCHED, emailAddressMatch=MATCHED, addressLine1Match=MATCHED, postcodeMatch=MATCHED, pregnantChildDOBMatch=NOT_SUPPLIED, dwpHouseholdIdentifier=dwpHousehold1, hmrcHouseholdIdentifier=hmrcHousehold1, dobOfChildrenUnder4=[2019-09-06, 2016-09-06], qualifyingReason=UNIVERSAL_CREDIT), voucherEntitlement=PaymentCycleVoucherEntitlement(vouchersForChildrenUnderOne=8, vouchersForChildrenBetweenOneAndFour=4, vouchersForPregnancy=4, totalVoucherEntitlement=16, singleVoucherValueInPence=310, totalVoucherValueInPence=4960, backdatedVouchers=0, voucherEntitlements=[VoucherEntitlement(vouchersForChildrenUnderOne=2, vouchersForChildrenBetweenOneAndFour=1, vouchersForPregnancy=1, totalVoucherEntitlement=4, singleVoucherValueInPence=310, totalVoucherValueInPence=1240, entitlementDate=2020-02-07), VoucherEntitlement(vouchersForChildrenUnderOne=2, vouchersForChildrenBetweenOneAndFour=1, vouchersForPregnancy=1, totalVoucherEntitlement=4, singleVoucherValueInPence=310, totalVoucherValueInPence=1240, entitlementDate=2020-02-14), VoucherEntitlement(vouchersForChildrenUnderOne=2, vouchersForChildrenBetweenOneAndFour=1, vouchersForPregnancy=1, totalVoucherEntitlement=4, singleVoucherValueInPence=310, totalVoucherValueInPence=1240, entitlementDate=2020-02-21), VoucherEntitlement(vouchersForChildrenUnderOne=2, vouchersForChildrenBetweenOneAndFour=1, vouchersForPregnancy=1, totalVoucherEntitlement=4, singleVoucherValueInPence=310, totalVoucherValueInPence=1240, entitlementDate=2020-02-28)]), expectedDeliveryDate=2020-03-05, totalVouchers=16, totalEntitlementAmountInPence=4960, cardBalanceInPence=null, cardBalanceTimestamp=null, paymentCycleStatus=NEW) shouldReturnTrueWhenClaimantIsPregnantAfterPaymentCycle(PaymentCycle)[3] 0s passed
[1] 2020-03-06, 2020-03-13 shouldReturnTrueWhenClaimantIsPregnantInPaymentCycle(LocalDate, LocalDate)[1] 0s passed
[2] 2020-03-06, 2020-03-06 shouldReturnTrueWhenClaimantIsPregnantInPaymentCycle(LocalDate, LocalDate)[2] 0s passed
[3] 2020-03-06, 2020-02-28 shouldReturnTrueWhenClaimantIsPregnantInPaymentCycle(LocalDate, LocalDate)[3] 0s passed
[4] 2020-03-06, 2019-12-13 shouldReturnTrueWhenClaimantIsPregnantInPaymentCycle(LocalDate, LocalDate)[4] 0s passed
shouldReturnTrueWhenPaymentCycleIsSecondToLastOneWithPregnancyVouchers() shouldReturnTrueWhenPaymentCycleIsSecondToLastOneWithPregnancyVouchers() 0.001s passed
[1] 2020-03-06, 2020-03-13 shouldReturnTrueWhenUnder18PregnantClaimantIsEntitledToVoucher(LocalDate, LocalDate)[1] 0.001s passed
[2] 2020-03-06, 2020-03-06 shouldReturnTrueWhenUnder18PregnantClaimantIsEntitledToVoucher(LocalDate, LocalDate)[2] 0.001s passed
[3] 2020-03-06, 2020-02-28 shouldReturnTrueWhenUnder18PregnantClaimantIsEntitledToVoucher(LocalDate, LocalDate)[3] 0s passed
[4] 2020-03-06, 2020-02-07 shouldReturnTrueWhenUnder18PregnantClaimantIsEntitledToVoucher(LocalDate, LocalDate)[4] 0s passed
shouldThrowExceptionWhenEntitlementDateIsNull() shouldThrowExceptionWhenEntitlementDateIsNull() 0s passed