Exemplo n.º 1
0
 public function testSimpleDistances()
 {
     $Distance = new Distance();
     $this->assertTrue($Distance->isZero());
     $this->assertFalse($Distance->isNegative());
     $this->assertEquals(10, $Distance->set(10)->kilometer());
     $this->assertEquals(20, $Distance->multiply(2)->kilometer());
     $this->assertEquals(21.1, $Distance->add(new Distance(1.1))->kilometer());
     $this->assertFalse($Distance->isZero());
     $this->assertEquals(-0.9, $Distance->subtract(new Distance(22))->kilometer());
     $this->assertTrue($Distance->isNegative());
 }