def test_nine_hundred_and_ninety(self):
     result = get_roman_numeral(990)
     self.assertEqual('CMXC', result)
示例#2
0
 def test_five_hundred(self):
     result = get_roman_numeral(500)
     self.assertEqual('D', result)
示例#3
0
 def test_negative_number(self):
     with self.assertRaises(TypeError):
         result = get_roman_numeral(-1)
示例#4
0
 def test_sixteen(self):
     result = get_roman_numeral(16)
     self.assertEqual('XVI', result)
示例#5
0
 def test_thirty_four(self):
     result = get_roman_numeral(34)
     self.assertEqual('XXXIV', result)
示例#6
0
 def test_two_thousand_nine_hundred_and_ninety_nine(self):
     result = get_roman_numeral(2999)
     self.assertEqual('MMCMXCIX', result)
示例#7
0
 def test_five_thousand_four_hundred_and_ninety_four(self):
     result = get_roman_numeral(5494)
     self.assertEqual('MMMMMCDXCIV', result)
 def test_two_thousand_four_hundred_and_fourty_four(self):
     result = get_roman_numeral(2444)
     self.assertEqual('MMCDXLIV', result)
 def test_three_thousand(self):
     result = get_roman_numeral(3000)
     self.assertEqual('MMM', result)
示例#10
0
 def test_two_thousand_nine_hundred_and_ninety_nine(self):
     result = get_roman_numeral(2999)
     self.assertEqual('MMCMXCIX', result)
示例#11
0
 def test_one(self):
     result = get_roman_numeral(1)
     self.assertEqual('I', result)
示例#12
0
 def test_two_thousand_and_eight(self):
     result = get_roman_numeral(2008)
     self.assertEqual('MMVIII', result)
示例#13
0
 def test_nineteen_ninety_nine(self):
     result = get_roman_numeral(1999)
     self.assertEqual('MCMXCIX', result)
示例#14
0
 def test_nineteen_ninety(self):
     result = get_roman_numeral(1990)
     self.assertEqual('MCMXC', result)
示例#15
0
 def test_nine_hundred_and_ninety(self):
     result = get_roman_numeral(990)
     self.assertEqual('CMXC', result)
示例#16
0
 def test_five_thousand_four_hundred_and_ninety_four(self):
     result = get_roman_numeral(5494)
     self.assertEqual('MMMMMCDXCIV', result)
示例#17
0
 def test_nineteen_ninety_nine(self):
     result = get_roman_numeral(1999)
     self.assertEqual('MCMXCIX', result)
示例#18
0
 def test_ten(self):
     result = get_roman_numeral(10)
     self.assertEqual('X', result)
示例#19
0
 def test_two_thousand_four_hundred_and_fourty_four(self):
     result = get_roman_numeral(2444)
     self.assertEqual('MMCDXLIV', result)
示例#20
0
 def test_five(self):
     result = get_roman_numeral(5)
     self.assertEqual('V', result)
示例#21
0
 def test_five(self):
     result = get_roman_numeral(5)
     self.assertEqual('V', result)
示例#22
0
 def test_seven(self):
     result = get_roman_numeral(7)
     self.assertEqual('VII', result)
示例#23
0
 def test_four(self):
     result = get_roman_numeral(9)
     self.assertEqual('IX', result)
示例#24
0
 def test_sixteen(self):
     result = get_roman_numeral(16)
     self.assertEqual('XVI', result)
示例#25
0
 def test_fifty_nine(self):
     result = get_roman_numeral(59)
     self.assertEqual('LIX', result)
示例#26
0
 def test_twenty_eight(self):
     result = get_roman_numeral(28)
     self.assertEqual('XXVIII', result)
示例#27
0
 def test_eighty_eight(self):
     result = get_roman_numeral(88)
     self.assertEqual('LXXXVIII', result)
示例#28
0
 def test_four(self):
     result = get_roman_numeral(9)
     self.assertEqual('IX', result)
示例#29
0
 def test_empty_string(self):
     with self.assertRaises(TypeError):
         result = get_roman_numeral('')
示例#30
0
 def test_thirty_nine(self):
     result = get_roman_numeral(39)
     self.assertEqual('XXXIX', result)
示例#31
0
 def test_nineteen_eighty_nine(self):
     result = get_roman_numeral(1989)
     self.assertEqual('MCMLXXXIX', result)
示例#32
0
 def test_thirty_four(self):
     result = get_roman_numeral(34)
     self.assertEqual('XXXIV', result)
示例#33
0
 def test_nineteen_ninety(self):
     result = get_roman_numeral(1990)
     self.assertEqual('MCMXC', result)
示例#34
0
 def test_fifty(self):
     result = get_roman_numeral(50)
     self.assertEqual('L', result)
示例#35
0
 def test_two_thousand_and_eight(self):
     result = get_roman_numeral(2008)
     self.assertEqual('MMVIII', result)
示例#36
0
 def test_fifty_nine(self):
     result = get_roman_numeral(59)
     self.assertEqual('LIX', result)
示例#37
0
 def test_one(self):
     result = get_roman_numeral(1)
     self.assertEqual('I', result)
示例#38
0
 def test_one_hundred(self):
     result = get_roman_numeral(100)
     self.assertEqual('C', result)
示例#39
0
 def test_three_thousand(self):
     result = get_roman_numeral(3000)
     self.assertEqual('MMM', result)
示例#40
0
 def test_five_hundred(self):
     result = get_roman_numeral(500)
     self.assertEqual('D', result)
示例#41
0
 def test_ten(self):
     result = get_roman_numeral(10)
     self.assertEqual('X', result)
示例#42
0
 def test_one_thousand(self):
     result = get_roman_numeral(1000)
     self.assertEqual('M', result)
示例#43
0
 def test_seven(self):
     result = get_roman_numeral(7)
     self.assertEqual('VII', result)
示例#44
0
 def test_eighty_eight(self):
     result = get_roman_numeral(88)
     self.assertEqual('LXXXVIII', result)
示例#45
0
 def test_twenty_eight(self):
     result = get_roman_numeral(28)
     self.assertEqual('XXVIII', result)
示例#46
0
 def test_eighty_nine(self):
     result = get_roman_numeral(89)
     self.assertEqual('LXXXIX', result)
示例#47
0
 def test_thirty_nine(self):
     result = get_roman_numeral(39)
     self.assertEqual('XXXIX', result)
示例#48
0
 def test_negative_number(self):
     with self.assertRaises(TypeError):
         result = get_roman_numeral(-1)
示例#49
0
 def test_fifty(self):
     result = get_roman_numeral(50)
     self.assertEqual('L', result)
示例#50
0
 def test_none(self):
     with self.assertRaises(TypeError):
         result = get_roman_numeral(None)
示例#51
0
 def test_one_hundred(self):
     result = get_roman_numeral(100)
     self.assertEqual('C', result)
示例#52
0
 def test_empty_string(self):
     with self.assertRaises(TypeError):
         result = get_roman_numeral('')
示例#53
0
 def test_one_thousand(self):
     result = get_roman_numeral(1000)
     self.assertEqual('M', result)
示例#54
0
 def test_zero(self):
     with self.assertRaises(TypeError):
         result = get_roman_numeral(0)
示例#55
0
 def test_eighty_nine(self):
     result = get_roman_numeral(89)
     self.assertEqual('LXXXIX', result)
示例#56
0
 def test_alphacharacter(self):
     with self.assertRaises(TypeError) as e:
         result = get_roman_numeral('test')
     self.assertEqual(
         'The value you entered is invalid: {num} is not a positive integer.'
         .format(num='test'), str(e.exception))
示例#57
0
 def test_none(self):
     with self.assertRaises(TypeError):
         result = get_roman_numeral(None)
示例#58
0
 def test_four_hundred_and_fourty_eight(self):
     result = get_roman_numeral(448)
     self.assertEqual('CDXLVIII', result)
示例#59
0
 def test_zero(self):
     with self.assertRaises(TypeError):
         result = get_roman_numeral(0)
示例#60
0
 def test_nineteen_eighty_nine(self):
     result = get_roman_numeral(1989)
     self.assertEqual('MCMLXXXIX', result)