@@ -0,0 +1,2033 @@
+import unittest%0A%0A%0Aclass CalculatorTestCase(unittest.TestCase):%0A    def test_calculator_with_one_operation(self):%0A        calc = Calculator(%0A            operations=%7B%0A                'add': AddOperation%0A            %7D%0A        )%0A        res = calc.calculate(1, 5, 13, 2, 'add')%0A        self.assertEqual(res, 21)%0A%0A    def test_calculator_with_multiple_operations(self):%0A        calc = Calculator(%0A            operations=%7B%0A                'add': AddOperation,%0A                'subtract': SubtractOperation%0A            %7D%0A        )%0A        res = calc.calculate(1, 5, 13, 2, 'add')%0A        self.assertEqual(res, 21)%0A        res = calc.calculate(13, 3, 7, 'subtract')%0A        self.assertEqual(res, 3)%0A%0A    def test_calculator_invoked_with_an_invalid_operation(self):%0A        calc = Calculator(%0A            operations=%7B%0A                'add': AddOperation%0A            %7D%0A        )%0A        with self.assertRaises(OperationInvalidException):%0A            res = calc.calculate(1, 5, 13, 2, 'INVALID')%0A%0A%0Aclass AddOperationTestCase(unittest.TestCase):%0A    def test_add_operation_with_multiple_arguments(self):%0A        op = AddOperation(5, 1, 8, 3, 2)%0A        self.assertEqual(op.operate(), 19)%0A%0A    def test_add_operation_with_1_arguments(self):%0A        op = AddOperation(5)%0A        self.assertEqual(op.operate(), 5)%0A%0A    def test_add_operation_with_no_arguments(self):%0A        op = AddOperation()%0A        self.assertEqual(op.operate(), 0)%0A%0A%0Aclass SubtractOperationTestCase(unittest.TestCase):%0A    def test_subtract_operation_with_multiple_arguments(self):%0A        op = SubtractOperation(10, 1, 3, 2, 1)%0A        self.assertEqual(op.operate(), 3)%0A%0A    def test_subtract_operation_with_1_arguments(self):%0A        op = SubtractOperation(5)%0A        self.assertEqual(op.operate(), 5)%0A%0A    def test_subtract_operation_negative_result(self):%0A        op = SubtractOperation(5, 3, 3)%0A        self.assertEqual(op.operate(), -1)%0A%0A    def test_subtract_operation_with_no_arguments(self):%0A        op = SubtractOperation()%0A        self.assertEqual(op.operate(), 0)%0A

Create tests.py