From d2dc6dc08b8e4f73e2d8b795e0d4b6261f63ee81 Mon Sep 17 00:00:00 2001 From: fdai7783 Date: Thu, 18 Jan 2024 22:11:38 +0100 Subject: [PATCH] Added multiplication functionality and a test for it --- src/main/py/primitive_calculations.py | 4 ++++ src/test/py/test_primitive_calculations.py | 3 +++ 2 files changed, 7 insertions(+) diff --git a/src/main/py/primitive_calculations.py b/src/main/py/primitive_calculations.py index 478162b..3e42ec5 100644 --- a/src/main/py/primitive_calculations.py +++ b/src/main/py/primitive_calculations.py @@ -4,3 +4,7 @@ def add(first_number, second_number): def subract(first_number, second_number): return second_number - first_number + + +def multiply(first_number, second_number): + return first_number * second_number diff --git a/src/test/py/test_primitive_calculations.py b/src/test/py/test_primitive_calculations.py index be74b1d..7932ae0 100644 --- a/src/test/py/test_primitive_calculations.py +++ b/src/test/py/test_primitive_calculations.py @@ -27,6 +27,9 @@ class primitive_calculations(unittest.TestCase): def test_subtract_minus_5_minus_minus_5_equals_0(self): self.assertEqual(subract(-5, -5), 0) + def test_subtract_minus_5_minus_minus_5_equals_1(self): + self.assertEqual(multiply(5, 5), 25) + if __name__ == "__main__": unittest.main()