Files
core/tests/DiceBagTest.php
T
Austen McDonald a1196c2ec3 Add DiceBag and tests
closes #7
2016-04-16 13:16:00 -07:00

33 lines
730 B
PHP

<?php
declare(strict_types=1);
namespace LotGD\Core\Tests;
use LotGD\Core\DiceBag;
/**
* @backupGlobals disabled
* @backupStaticAttributes disabled
*/
class DiceBagTests extends \PHPUnit_Framework_TestCase {
public function testUniform() {
$db = new DiceBag();
$value = $db->uniform(0., 1.);
$this->assertGreaterThan(0, $value);
$this->assertLessThan(1, $value);
}
public function testNormal() {
$db = new DiceBag();
$value = $db->normal(0., 1.);
$this->assertGreaterThan(0, $value);
$this->assertLessThan(1, $value);
$value = $db->normal(1., 0.);
$this->assertGreaterThan(0, $value);
$this->assertLessThan(1, $value);
$this->assertEquals(0, $db->normal(0., 0.));
}
}