def test_get_sequel_no_index(self): s = SequelNumberHandler() index = s.get_sequel_no_index("Final Fantasy IX") self.assertEqual(14, index) index = s.get_sequel_no_index("Final Fantasy 9") self.assertEqual(14, index) index = s.get_sequel_no_index("Final Fantasy") self.assertEqual(-1, index)
def test_remove_sequel_no_one(self): s = SequelNumberHandler() result = s.remove_sequel_no_one("Arkanoid 1") self.assertEqual("Arkanoid", result) result = s.remove_sequel_no_one("Arkanoid I") self.assertEqual("Arkanoid", result) result = s.remove_sequel_no_one("Fifa 1998") self.assertEqual("Fifa 1998", result) result = s.remove_sequel_no_one("HANOI") self.assertEqual("HANOI", result)
def test_replace_int_to_roman(self): s = SequelNumberHandler() replaced = s.replace_int_to_roman("Final Fantasy 9") self.assertEqual("Final Fantasy IX", replaced) replaced = s.replace_int_to_roman("Final Fantasy 10") self.assertEqual("Final Fantasy X", replaced) replaced = s.replace_int_to_roman("Final Fantasy 11") self.assertEqual("Final Fantasy XI", replaced) replaced = s.replace_int_to_roman("Final Fantasy 12") self.assertEqual("Final Fantasy XII", replaced) replaced = s.replace_int_to_roman("Final Fantasy 13") self.assertEqual("Final Fantasy XIII", replaced) replaced = s.replace_int_to_roman("Final Fantasy 14") self.assertEqual("Final Fantasy XIV", replaced) replaced = s.replace_int_to_roman("Final Fantasy 15") self.assertEqual("Final Fantasy XV", replaced) replaced = s.replace_int_to_roman("Chuck Rock 2: Son of Chuck") self.assertEqual("Chuck Rock II: Son of Chuck", replaced)
def test_replace_roman_to_int(self): s = SequelNumberHandler() replaced = s.replace_roman_to_int("Final Fantasy IX") self.assertEqual("Final Fantasy 9", replaced) replaced = s.replace_roman_to_int("Final Fantasy X") self.assertEqual("Final Fantasy 10", replaced) replaced = s.replace_roman_to_int("Final Fantasy XI") self.assertEqual("Final Fantasy 11", replaced) replaced = s.replace_roman_to_int("Final Fantasy XII") self.assertEqual("Final Fantasy 12", replaced) replaced = s.replace_roman_to_int("Final Fantasy XIII") self.assertEqual("Final Fantasy 13", replaced) replaced = s.replace_roman_to_int("Final Fantasy XIV") self.assertEqual("Final Fantasy 14", replaced) replaced = s.replace_roman_to_int("Final Fantasy XV") self.assertEqual("Final Fantasy 15", replaced) replaced = s.replace_roman_to_int("Chuck Rock II: Son of Chuck") self.assertEqual("Chuck Rock 2: Son of Chuck", replaced) #Test names that contain roman numerals that should not be replaced replaced = s.replace_roman_to_int("Space Invaders") self.assertEqual("Space Invaders", replaced) replaced = s.replace_roman_to_int("Maniac Mansion") self.assertEqual("Maniac Mansion", replaced)