Browse Source

Added division functionality and one test for it

remotes/origin/feature/feature-primitive-calculations
fdai7783 11 months ago
parent
commit
c01de8115e
  1. 4
      src/main/py/primitive_calculations.py
  2. 3
      src/test/py/test_primitive_calculations.py

4
src/main/py/primitive_calculations.py

@ -8,3 +8,7 @@ def subract(first_number, second_number):
def multiply(first_number, second_number): def multiply(first_number, second_number):
return first_number * second_number return first_number * second_number
def divide(first_number, second_number):
return first_number / second_number

3
src/test/py/test_primitive_calculations.py

@ -33,6 +33,9 @@ class primitive_calculations(unittest.TestCase):
def test_multiply_minus_5_multiply_minus_5_equals_25(self): def test_multiply_minus_5_multiply_minus_5_equals_25(self):
self.assertEqual(multiply(-5, -5), 25) self.assertEqual(multiply(-5, -5), 25)
def test_divide_10_by_2_equals_5(self):
self.assertEqual(divide(10, 2), 5)
if __name__ == "__main__": if __name__ == "__main__":
unittest.main() unittest.main()
Loading…
Cancel
Save