|
@@ 90-96 (lines=7) @@
|
| 87 |
|
$sut->compare($price1); |
| 88 |
|
} |
| 89 |
|
|
| 90 |
|
public function testAdd() |
| 91 |
|
{ |
| 92 |
|
$price = Price::fromNetCost(new Money(10, 'GBP'), new TaxRate(20)); |
| 93 |
|
$sut = (Price::fromNetCost(new Money(10, 'GBP'), new TaxRate(20)))->add($price); |
| 94 |
|
|
| 95 |
|
self::assertTrue($sut->getNet()->equals(new Money(20, 'GBP')), 'Values did not add up'); |
| 96 |
|
} |
| 97 |
|
|
| 98 |
|
public function testSubtract() |
| 99 |
|
{ |
|
@@ 98-104 (lines=7) @@
|
| 95 |
|
self::assertTrue($sut->getNet()->equals(new Money(20, 'GBP')), 'Values did not add up'); |
| 96 |
|
} |
| 97 |
|
|
| 98 |
|
public function testSubtract() |
| 99 |
|
{ |
| 100 |
|
$price = Price::fromNetCost(new Money(5, 'GBP'), new TaxRate(20)); |
| 101 |
|
$sut = (Price::fromNetCost(new Money(10, 'GBP'), new TaxRate(20)))->subtract($price); |
| 102 |
|
|
| 103 |
|
self::assertTrue($sut->getNet()->equals(new Money(5, 'GBP')), 'Value not subtracted'); |
| 104 |
|
} |
| 105 |
|
|
| 106 |
|
public function testMultiply() |
| 107 |
|
{ |