Skip to content

Commit

Permalink
Added unit testing for Gravitation & ConstantQuantity. [#11]
Browse files Browse the repository at this point in the history
  • Loading branch information
JordanRL committed Aug 27, 2015
1 parent fd50a70 commit 6492b1f
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
File renamed without changes.
41 changes: 41 additions & 0 deletions tests/Samsara/Newton/Units/ConstantsTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?php

namespace Samsara\Newton\Units\PhysicsConstants;

class ConstantsTest extends \PHPUnit_Framework_TestCase
{

public function testGravitation()
{
$gravitation = new Gravitation();

$this->assertInstanceOf(
'Samsara\\Newton\\Units\\PhysicsConstants\\Gravitation',
$gravitation
);

$this->assertEquals(
'0.0000000000667384',
$gravitation->getValue()
);

$gravitation->preConvertedAdd(1);
$gravitation->preConvertedMultiply(2);
$gravitation->preConvertedDivide(10);
$gravitation->preConvertedSubtract(1);
$gravitation->add($gravitation);
$gravitation->add($gravitation);
$gravitation->subtract($gravitation);

$this->assertEquals(
'0.0000000000667384',
$gravitation->getValue()
);

$this->assertEquals(
'N (m/kg)^2',
$gravitation->getUnit()
);
}

}

0 comments on commit 6492b1f

Please sign in to comment.