From 17c77e5b5da1e0b88c3cd9327b97ad8e55327df6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=A1clav=20Uruba?= Date: Fri, 25 Sep 2015 21:02:06 +0200 Subject: [PATCH] =?UTF-8?q?=E2=80=93=20expanded=20tests=20for=20classes=20?= =?UTF-8?q?SimpleDiscountCalculator=20and=20SimpleInterestCalculator?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/SimpleDiscountCalculatorTest.php | 7 +++++++ tests/SimpleInterestCalculatorTest.php | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/tests/SimpleDiscountCalculatorTest.php b/tests/SimpleDiscountCalculatorTest.php index 37a6da5..7007f5b 100644 --- a/tests/SimpleDiscountCalculatorTest.php +++ b/tests/SimpleDiscountCalculatorTest.php @@ -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()); } /** diff --git a/tests/SimpleInterestCalculatorTest.php b/tests/SimpleInterestCalculatorTest.php index 380ffa4..25389a2 100644 --- a/tests/SimpleInterestCalculatorTest.php +++ b/tests/SimpleInterestCalculatorTest.php @@ -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()); } /**