Example #1
0
 public function testKnowsTotalTaxesOfGoodThree()
 {
     $this->cart->add(Good::withAttributes(['type' => 'perfume', 'price' => 27.99, 'imported' => true]));
     $this->cart->add(Good::withAttributes(['type' => 'perfume', 'price' => 18.99, 'imported' => false]));
     $this->cart->add(Good::withAttributes(['type' => 'medicals', 'price' => 9.75, 'imported' => false]));
     $this->cart->add(Good::withAttributes(['type' => 'food', 'price' => 11.25, 'imported' => true]));
     $this->assertEquals(6.7, $this->cart->salesTaxes());
     $this->assertEquals(74.68000000000001, $this->cart->totalAmount());
 }
Example #2
0
 public function testFinalValueWhenNotImportedAndExemptFromTaxes()
 {
     $good = Good::withAttributes(['type' => 'medicals', 'price' => 9.75, 'imported' => false]);
     $this->assertEquals(9.75, $good->finalValue());
 }