Slide 37
Slide 37 text
@pelshoff
@pelshoff
/** @test */
public function can_adjust()
{
$bindPremium = new SinglePremium(Money::
GBP(365_00), ...);
$adjustPremium = new SinglePremium(Money::
GBP(375_00), ...);
$deltaPremium = new SinglePremium(Money::
GBP(5_04), ...);
$expected = Transactions::
of([
new PremiumTransaction(LocalDate::
of(2019, 1, 1), $bindPremium, $bindPremium),
new PremiumTransaction(LocalDate::
of(2019, 7, 1), $adjustPremium
, $deltaPremium),
]);
$actual = Transactions::
of(
PremiumCalculation::
for(TermPeriod::of(...))
->act(new CurrentPremiumBind(
$bindPremium))
->act(new CurrentPremiumAdjustment(LocalDate::
of(2019, 7, 1), $adjustPremium
))
->newTransactions
()
);
$this->assertEquals($expected, $actual);
}
tests/Premium/PremiumCalculationTest.php
Photo by Matt Cramblett on Unsplash