Example #1
0
class testNumberToWordTranslator(unittest.TestCase):
    def setUp(self):
        self.traductor = Translator()

    def test_should_return_Zero_if_number_is_0(self):
        self.assertEqual(self.traductor.numberToWordTranslate("Zero"), 0)

    def test_should_split_by_thousands(self):
        self.assertEqual(self.traductor.splitByThousands(2705), [705,2])

    def test_should_return_sub_thousands_function_a_string_below_19_if_passed_number_is_below_19(self):
        self.assertEqual(self.traductor.subThousand(3), "three")

    def test_should_return_sub_thousands_function_a_string_below_99_if_passed_number_is_below_99(self):
        self.assertEqual(self.traductor.subThousand(33), "thirty three")

    def test_should_return_sub_thousands_function_a_string_above_99_if_passed_number_is_above_99(self):
        self.assertEqual(self.traductor.subThousand(333), "three hundred and thirty three")