public function it_should_be_able_to_get_total_wrapping_paper_area_from_contained_boxes(BoxInterface $box1, BoxInterface $box2) { $box1Area = rand(1, 500); $box2Area = rand(1, 500); $box1->getWrappingPaperArea()->willReturn($box1Area); $box2->getWrappingPaperArea()->willReturn($box2Area); $this->addBox($box1); $this->addBox($box2); $this->getTotalWrappingPaperArea()->shouldBe($box1Area + $box2Area); }
function it_can_get_total_wrapping_area(BoxInterface $box1, BoxInterface $box2) { $boxArea1 = 78; $boxArea2 = 15; $box1->getWrappingPaperArea()->willReturn($boxArea1); $box2->getWrappingPaperArea()->willReturn($boxArea2); $this->addBox($box1); $this->addBox($box2); $this->getTotalWrappingArea()->shouldBe($boxArea1 + $boxArea2); }