Adds a normal dice to the dice bag

This commit is contained in:
Vassyli
2017-09-22 12:10:11 +02:00
parent 51a102f981
commit a287313f6f
2 changed files with 44 additions and 2 deletions
+19
View File
@@ -51,4 +51,23 @@ class DiceBagTests extends \PHPUnit_Framework_TestCase
$this->assertGreaterThanOrEqual(1, $value);
$this->assertLessThanOrEqual(3, $value);
}
public function testDice()
{
$db = new DiceBag();
$value = $db->dice(1, 6);
$this->assertGreaterThanOrEqual(1, $value);
$this->assertLessThanOrEqual(6, $value);
$value = $db->dice(5, 5);
$this->assertSame(5, $value);
$value = $db->dice(1, 3);
$this->assertGreaterThanOrEqual(1, $value);
$this->assertLessThanOrEqual(3, $value);
$value = $db->dice(3, 1);
$this->assertGreaterThanOrEqual(1, $value);
$this->assertLessThanOrEqual(3, $value);
}
}