From 31666ce4df8923466ef3872d6cdf56d1b5897d7f Mon Sep 17 00:00:00 2001 From: fdai7764 Date: Sat, 27 Jan 2024 13:43:03 +0100 Subject: [PATCH] added test to check if multiplication of two roots with one being zero returns zero as well as corresponding functionality --- src/main/py/calculations_with_roots.py | 2 ++ src/test/py/test_calculations_with_roots.py | 17 +++++++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 src/main/py/calculations_with_roots.py create mode 100644 src/test/py/test_calculations_with_roots.py diff --git a/src/main/py/calculations_with_roots.py b/src/main/py/calculations_with_roots.py new file mode 100644 index 0000000..3cf4ee6 --- /dev/null +++ b/src/main/py/calculations_with_roots.py @@ -0,0 +1,2 @@ +def multiplyRoots(first_number, second_number): + return 0 \ No newline at end of file diff --git a/src/test/py/test_calculations_with_roots.py b/src/test/py/test_calculations_with_roots.py new file mode 100644 index 0000000..713dcc2 --- /dev/null +++ b/src/test/py/test_calculations_with_roots.py @@ -0,0 +1,17 @@ +import unittest +from src.main.py.calculations_with_roots import * + + +class calculationsWithRoots(unittest.TestCase): + def setUp(self): + pass + + def tearDown(self): + pass + + def test_sqrt_0_times_sqrt_8_should_be_0(self): + self.assertEqual(multiplyRoots(0, 8), 0) + + +if __name__ == '__main__': + unittest.main()