Ejemplo n.º 1
0
 public function testCanCalculateSurfaceVolumeOfTwoDifferentShapes()
 {
     $square = new Square(2);
     $circle = new Circle(4);
     $calculator = new Calculator();
     // expected value
     $value = $square->volume() + $circle->volume();
     $this->assertEquals($value, $calculator->totalVolume(compact('square', 'circle')));
 }
Ejemplo n.º 2
0
 public function testVolumeAlwaysReturnsZero()
 {
     $square = new Square(0);
     $this->assertEquals(0, $square->volume());
     $square = new Square(2);
     $this->assertEquals(0, $square->volume());
     $square = new Square(3.14);
     $this->assertEquals(0, $square->volume());
 }