Пример #1
0
class TotalMagicNumbers(object):
    def __init__(self):
        self.magicNumbers = CalculateMagicNumbers()

    def calculate(self, data=[]):

        result = 0

        for numbers in data:
            init = numbers[0]
            end = numbers[1]

            result += self.magicNumbers.calculate(init, end)

        return result
 def test_calculate_magic_numbers(self):
     init = 8
     end = 27
     magic_number = CalculateMagicNumbers()
     self.assertEqual(magic_number.calculate(init, end), 2)