| @@ 140-150 (lines=11) @@ | ||
| 137 | $this->assertEquals($expected, $result); | |
| 138 | } | |
| 139 | ||
| 140 | public function testConvertUsingDatabaseWhenRateExistInDatabaseAndNoNeedToBeUpdated() | |
| 141 |     { | |
| 142 | $amount = 20.00; | |
| 143 | $fromCurrency = 'EUR'; | |
| 144 | $toCurrency = 'GBP'; | |
| 145 | ||
| 146 | $result = $this->CurrencyConverter->convert($amount, $fromCurrency, $toCurrency); | |
| 147 | $expected = round(number_format(0.8 * 20.00, 2), 2); | |
| 148 | ||
| 149 | $this->assertEquals($expected, $result); | |
| 150 | } | |
| 151 | ||
| 152 | public function testConvertUsingDatabaseWhenRateExistInDatabaseAndNeedToBeUpdated() | |
| 153 |     { | |
| @@ 140-151 (lines=12) @@ | ||
| 137 | $this->assertEquals($expected, $result); | |
| 138 | } | |
| 139 | ||
| 140 | public function testConvertUsingDatabaseWhenRateExistInDatabaseAndNoNeedToBeUpdated() | |
| 141 |     { | |
| 142 | $amount = 20.00; | |
| 143 | $fromCurrency = 'EUR'; | |
| 144 | $toCurrency = 'GBP'; | |
| 145 | ||
| 146 | $result = $this->CurrencyConverter->convert($amount, $fromCurrency, $toCurrency); | |
| 147 | $expected = round(number_format(0.8 * 20.00, 2), 2); | |
| 148 | ||
| 149 | $this->assertEquals($expected, $result); | |
| 150 | ||
| 151 | } | |
| 152 | ||
| 153 | public function testConvertUsingDatabaseWhenRateExistInDatabaseAndNeedToBeUpdated() | |
| 154 |     { | |