Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
test usati per il code kata di giugno 2012 al PUG Roma
<?php
#require_once __DIR__ . '/../RomanNumber.php';
class romanNumberTest extends \PHPUnit_Framework_TestCase
{
public function testOne()
{
$this->assertEquals('I', rnConvert(1));
}
public function testTwo()
{
$this->assertEquals('II', rnConvert(2));
}
public function testThree()
{
$this->assertEquals('III', rnConvert(3));
}
public function testFour()
{
$this->assertEquals('IV', rnConvert(4));
}
public function testFive()
{
$this->assertEquals('V', rnConvert(5));
}
public function testSix()
{
$this->assertEquals('VI', rnConvert(6));
}
public function testSeven()
{
$this->assertEquals('VII', rnConvert(7));
}
public function testEight()
{
$this->assertEquals('VIII', rnConvert(8));
}
public function testNine()
{
$this->assertEquals('IX', rnConvert(9));
}
public function testTen()
{
$this->assertEquals('X', rnConvert(10));
}
public function testOthers()
{
$this->assertEquals('XI', rnConvert(11));
$this->assertEquals('XII', rnConvert(12));
$this->assertEquals('XIII', rnConvert(13));
$this->assertEquals('XIV', rnConvert(14));
$this->assertEquals('XV', rnConvert(15));
$this->assertEquals('XVI', rnConvert(16));
$this->assertEquals('XVII', rnConvert(17));
$this->assertEquals('XVIII', rnConvert(18));
$this->assertEquals('XIX', rnConvert(19));
$this->assertEquals('XX', rnConvert(20));
$this->assertEquals('XXI', rnConvert(21));
$this->assertEquals('XXII', rnConvert(22));
$this->assertEquals('XXIII', rnConvert(23));
$this->assertEquals('XXIV', rnConvert(24));
$this->assertEquals('XXV', rnConvert(25));
$this->assertEquals('XXVI', rnConvert(26));
$this->assertEquals('XXVII', rnConvert(27));
$this->assertEquals('XXVIII', rnConvert(28));
$this->assertEquals('XXIX', rnConvert(29));
$this->assertEquals('XXX', rnConvert(30));
$this->assertEquals('XXXI', rnConvert(31));
$this->assertEquals('XXXII', rnConvert(32));
$this->assertEquals('XXXIII', rnConvert(33));
$this->assertEquals('XXXIV', rnConvert(34));
$this->assertEquals('XXXV', rnConvert(35));
$this->assertEquals('XXXVI', rnConvert(36));
$this->assertEquals('XXXVII', rnConvert(37));
$this->assertEquals('XXXVIII', rnConvert(38));
$this->assertEquals('XXXIX', rnConvert(39));
$this->assertEquals('XL', rnConvert(40));
$this->assertEquals('XLI', rnConvert(41));
$this->assertEquals('XLII', rnConvert(42));
$this->assertEquals('XLIII', rnConvert(43));
$this->assertEquals('XLIV', rnConvert(44));
$this->assertEquals('XLV', rnConvert(45));
$this->assertEquals('XLVI', rnConvert(46));
$this->assertEquals('XLVII', rnConvert(47));
$this->assertEquals('XLVIII', rnConvert(48));
$this->assertEquals('XLIX', rnConvert(49));
}
public function testFifty()
{
$this->assertEquals('L', rnConvert(50));
$this->assertEquals('LI', rnConvert(51));
$this->assertEquals('LII', rnConvert(52));
$this->assertEquals('LIII', rnConvert(53));
$this->assertEquals('LIV', rnConvert(54));
$this->assertEquals('LV', rnConvert(55));
$this->assertEquals('LVI', rnConvert(56));
$this->assertEquals('LVII', rnConvert(57));
$this->assertEquals('LVIII', rnConvert(58));
$this->assertEquals('LIX', rnConvert(59));
$this->assertEquals('LX', rnConvert(60));
$this->assertEquals('LXX', rnConvert(70));
$this->assertEquals('LXXX', rnConvert(80));
$this->assertEquals('XC', rnConvert(90));
$this->assertEquals('XCIX', rnConvert(99));
}
public function testHundred()
{
$this->assertEquals('C', rnConvert(100));
$this->assertEquals('CI', rnConvert(101));
}
public function testFiveHundred()
{
$this->assertEquals('D', rnConvert(500));
$this->assertEquals('DI', rnConvert(501));
$this->assertEquals('DC', rnConvert(600));
$this->assertEquals('DCC', rnConvert(700));
$this->assertEquals('DCCC', rnConvert(800));
$this->assertEquals('CM', rnConvert(900));
$this->assertEquals('CMI', rnConvert(901));
}
public function testThousand()
{
$this->assertEquals('M', rnConvert(1000));
$this->assertEquals('MCMLXXIV', rnConvert(1974));
$this->assertEquals('MM', rnConvert(2000));
$this->assertEquals('MMXII', rnConvert(2012));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment