def test_case_3(self):
     roman_numerals = RomanNumerals()
     roman_number = roman_numerals.to_roman('3')
     self.assertEqual(roman_number, 'III')
 def test_case_5(self):
     roman_numerals = RomanNumerals()
     roman_number = roman_numerals.to_roman('5')
     self.assertEqual(roman_number, 'V')
 def test_case_1999(self):
     roman_numerals = RomanNumerals()
     roman_number = roman_numerals.to_roman('1999')
     self.assertEqual(roman_number, 'MCMXCIX')
示例#4
0
 def test_to_roman(self):
     self.assertEqual(RomanNumerals.to_roman(1), 'I')
     self.assertEqual(RomanNumerals.to_roman(3), 'III')
     self.assertEqual(RomanNumerals.to_roman(4), 'IV')
     self.assertEqual(RomanNumerals.to_roman(6), 'VI')
     self.assertEqual(RomanNumerals.to_roman(8), 'VIII')
     self.assertEqual(RomanNumerals.to_roman(9), 'IX')
     self.assertEqual(RomanNumerals.to_roman(14), 'XIV')
     self.assertEqual(RomanNumerals.to_roman(17), 'XVII')
     self.assertEqual(RomanNumerals.to_roman(19), 'XIX')
     self.assertEqual(RomanNumerals.to_roman(20), 'XX')
     self.assertEqual(RomanNumerals.to_roman(22), 'XXII')
     self.assertEqual(RomanNumerals.to_roman(40), 'XL')
     self.assertEqual(RomanNumerals.to_roman(490), 'XD')
     self.assertEqual(RomanNumerals.to_roman(786), 'DCCLXXXVI')
     self.assertEqual(RomanNumerals.to_roman(900), 'CM')
     self.assertEqual(RomanNumerals.to_roman(904), 'CMIV')
     self.assertEqual(RomanNumerals.to_roman(1000), 'M')
     self.assertEqual(RomanNumerals.to_roman(1990), 'MCMXC')
     self.assertEqual(RomanNumerals.to_roman(3888), 'MMMDCCCLXXXVIII')