|
@@ 24-35 (lines=12) @@
|
| 21 |
|
$this->currencyConverter = new CurrencyConverterComponent(new ComponentRegistry(new Controller)); |
| 22 |
|
} |
| 23 |
|
|
| 24 |
|
public function testAmountWithComma() |
| 25 |
|
{ |
| 26 |
|
$fromCurrency = 'EUR'; |
| 27 |
|
$toCurrency = 'GBP'; |
| 28 |
|
$amount = '20,00'; |
| 29 |
|
$saveIntoDb = 0; |
| 30 |
|
$hourDifference = 0; |
| 31 |
|
$dataSource = 'test'; |
| 32 |
|
|
| 33 |
|
$result = $this->currencyConverter->convert($fromCurrency, $toCurrency, $amount, $saveIntoDb, $hourDifference, $dataSource); |
| 34 |
|
$this->assertGreaterThan((float)$result, (float)$amount); |
| 35 |
|
} |
| 36 |
|
|
| 37 |
|
public function testAmountWithPoint() |
| 38 |
|
{ |
|
@@ 37-48 (lines=12) @@
|
| 34 |
|
$this->assertGreaterThan((float)$result, (float)$amount); |
| 35 |
|
} |
| 36 |
|
|
| 37 |
|
public function testAmountWithPoint() |
| 38 |
|
{ |
| 39 |
|
$fromCurrency = 'EUR'; |
| 40 |
|
$toCurrency = 'GBP'; |
| 41 |
|
$amount = '20.00'; |
| 42 |
|
$saveIntoDb = 0; |
| 43 |
|
$hourDifference = 0; |
| 44 |
|
$dataSource = 'test'; |
| 45 |
|
|
| 46 |
|
$result = $this->currencyConverter->convert($fromCurrency, $toCurrency, $amount, $saveIntoDb, $hourDifference, $dataSource); |
| 47 |
|
$this->assertGreaterThan($result, $amount); |
| 48 |
|
} |
| 49 |
|
|
| 50 |
|
public function testAmountWithCommaSavedInDatabase() |
| 51 |
|
{ |
|
@@ 50-61 (lines=12) @@
|
| 47 |
|
$this->assertGreaterThan($result, $amount); |
| 48 |
|
} |
| 49 |
|
|
| 50 |
|
public function testAmountWithCommaSavedInDatabase() |
| 51 |
|
{ |
| 52 |
|
$fromCurrency = 'EUR'; |
| 53 |
|
$toCurrency = 'GBP'; |
| 54 |
|
$amount = '20,00'; |
| 55 |
|
$saveIntoDb = true; |
| 56 |
|
$hourDifference = 1; |
| 57 |
|
$dataSource = 'test'; |
| 58 |
|
|
| 59 |
|
$result = $this->currencyConverter->convert($fromCurrency, $toCurrency, $amount, $saveIntoDb, $hourDifference, $dataSource); |
| 60 |
|
$this->assertGreaterThan($result, $amount); |
| 61 |
|
} |
| 62 |
|
|
| 63 |
|
public function testAmountWithPointSavedInDatabase() |
| 64 |
|
{ |
|
@@ 63-74 (lines=12) @@
|
| 60 |
|
$this->assertGreaterThan($result, $amount); |
| 61 |
|
} |
| 62 |
|
|
| 63 |
|
public function testAmountWithPointSavedInDatabase() |
| 64 |
|
{ |
| 65 |
|
$fromCurrency = 'EUR'; |
| 66 |
|
$toCurrency = 'GBP'; |
| 67 |
|
$amount = '20.00'; |
| 68 |
|
$saveIntoDb = 1; |
| 69 |
|
$hourDifference = 1; |
| 70 |
|
$dataSource = 'test'; |
| 71 |
|
|
| 72 |
|
$result = $this->currencyConverter->convert($fromCurrency, $toCurrency, $amount, $saveIntoDb, $hourDifference, $dataSource); |
| 73 |
|
$this->assertGreaterThan($result, $amount); |
| 74 |
|
} |
| 75 |
|
|
| 76 |
|
public function testConvertToPDS() |
| 77 |
|
{ |
|
@@ 76-87 (lines=12) @@
|
| 73 |
|
$this->assertGreaterThan($result, $amount); |
| 74 |
|
} |
| 75 |
|
|
| 76 |
|
public function testConvertToPDS() |
| 77 |
|
{ |
| 78 |
|
$fromCurrency = 'EUR'; |
| 79 |
|
$toCurrency = 'PDS'; |
| 80 |
|
$amount = '20.00'; |
| 81 |
|
$saveIntoDb = 1; |
| 82 |
|
$hourDifference = 1; |
| 83 |
|
$dataSource = 'test'; |
| 84 |
|
|
| 85 |
|
$result = $this->currencyConverter->convert($fromCurrency, $toCurrency, $amount, $saveIntoDb, $hourDifference, $dataSource); |
| 86 |
|
$this->assertGreaterThan($result, $amount); |
| 87 |
|
} |
| 88 |
|
|
| 89 |
|
public function testConvertFromPDS() |
| 90 |
|
{ |
|
@@ 89-100 (lines=12) @@
|
| 86 |
|
$this->assertGreaterThan($result, $amount); |
| 87 |
|
} |
| 88 |
|
|
| 89 |
|
public function testConvertFromPDS() |
| 90 |
|
{ |
| 91 |
|
$fromCurrency = 'PDS'; |
| 92 |
|
$toCurrency = 'EUR'; |
| 93 |
|
$amount = '20.00'; |
| 94 |
|
$saveIntoDb = 1; |
| 95 |
|
$hourDifference = 1; |
| 96 |
|
$dataSource = 'test'; |
| 97 |
|
|
| 98 |
|
$result = $this->currencyConverter->convert($fromCurrency, $toCurrency, $amount, $saveIntoDb, $hourDifference, $dataSource); |
| 99 |
|
$this->assertGreaterThan($amount, $result); |
| 100 |
|
} |
| 101 |
|
|
| 102 |
|
public function testConvertSameCurrency() |
| 103 |
|
{ |
|
@@ 102-113 (lines=12) @@
|
| 99 |
|
$this->assertGreaterThan($amount, $result); |
| 100 |
|
} |
| 101 |
|
|
| 102 |
|
public function testConvertSameCurrency() |
| 103 |
|
{ |
| 104 |
|
$fromCurrency = 'EUR'; |
| 105 |
|
$toCurrency = 'EUR'; |
| 106 |
|
$amount = '20.00'; |
| 107 |
|
$saveIntoDb = 1; |
| 108 |
|
$hourDifference = 1; |
| 109 |
|
$dataSource = 'test'; |
| 110 |
|
|
| 111 |
|
$result = $this->currencyConverter->convert($fromCurrency, $toCurrency, $amount, $saveIntoDb, $hourDifference, $dataSource); |
| 112 |
|
$this->assertEquals($result, $amount); |
| 113 |
|
} |
| 114 |
|
|
| 115 |
|
public function testInsertCurrency() |
| 116 |
|
{ |