Skip to content

Commit

Permalink
– expanded tests for classes SimpleDiscountCalculator and SimpleInter…
Browse files Browse the repository at this point in the history
…estCalculator
  • Loading branch information
uruba committed Sep 25, 2015
1 parent 217cd88 commit 17c77e5
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/SimpleDiscountCalculatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@ public function testSimpleDiscountAmountFactory() {
*/
private function assertDiscountAmount(SimpleDiscountCalculator $discountCalculator) {
$this->assertEquals(6500, $discountCalculator->getDiscountAmount());

$this->assertEquals(100000, $discountCalculator->getAmountDue());
$this->assertEquals(0.13, $discountCalculator->getAnnualDiscountRate());
$this->assertEquals(TimeSpan::asDuration(0, 6), $discountCalculator->getTime());
$this->assertEquals(0.5, $discountCalculator->getTimeInYears());
$this->assertEquals(6, $discountCalculator->getTimeInMonths());
$this->assertEquals(180, $discountCalculator->getTimeInDays());
}

/**
Expand Down
7 changes: 7 additions & 0 deletions tests/SimpleInterestCalculatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@ public function testSimpleInterestAmountFactory() {
*/
private function assertInterestAmount(SimpleInterestCalculator $interestCalculator) {
$this->assertEquals(3.75, $interestCalculator->getInterestAmount());

$this->assertEquals(100, $interestCalculator->getPrincipal());
$this->assertEquals(0.0375, $interestCalculator->getAnnualInterestRate());
$this->assertEquals(TimeSpan::asDuration(1), $interestCalculator->getTime());
$this->assertEquals(1, $interestCalculator->getTimeInYears());
$this->assertEquals(12, $interestCalculator->getTimeInMonths());
$this->assertEquals(360, $interestCalculator->getTimeInDays());
}

/**
Expand Down

0 comments on commit 17c77e5

Please sign in to comment.