Browse Source

Added subtraction functionality and one test for it

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

4
src/main/py/primitive_calculations.py

@ -1,2 +1,6 @@
def add(first_number, second_number): def add(first_number, second_number):
return first_number + second_number return first_number + second_number
def subract(first_number, second_number):
return second_number - first_number

3
src/test/py/test_primitive_calculations.py

@ -21,6 +21,9 @@ class primitive_calculations(unittest.TestCase):
def test_add_1_dot_5_plus_1_dot_5_equals_3(self): def test_add_1_dot_5_plus_1_dot_5_equals_3(self):
self.assertEqual(add(1.5, 1.5), 3) self.assertEqual(add(1.5, 1.5), 3)
def test_subtract_5_minus_5_equals_10(self):
self.assertEqual(subract(5, 5), 0)
if __name__ == "__main__": if __name__ == "__main__":
unittest.main() unittest.main()
Loading…
Cancel
Save