From 49d130a2b1fc7f114f4d6ebab791d33be780de3b Mon Sep 17 00:00:00 2001 From: fdai7783 Date: Sun, 4 Feb 2024 11:51:50 +0100 Subject: [PATCH] Added another testcase for identity and additions in code to fulfill it --- src/main/py/logical_operations.py | 5 ++++- src/test/py/test_logical_operations.py | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/py/logical_operations.py b/src/main/py/logical_operations.py index 20d86c2..a9ff3c1 100644 --- a/src/main/py/logical_operations.py +++ b/src/main/py/logical_operations.py @@ -1,2 +1,5 @@ def identity_conjunctive(variable, zero): - return variable + if variable == 1 and zero == 0: + return variable + else: + return None diff --git a/src/test/py/test_logical_operations.py b/src/test/py/test_logical_operations.py index 628b075..9031510 100644 --- a/src/test/py/test_logical_operations.py +++ b/src/test/py/test_logical_operations.py @@ -12,6 +12,9 @@ class calculationsWithRoots(unittest.TestCase): def test_identity_x_and_0_equals_x(self): self.assertEqual(identity_conjunctive(1, 0), 1) + def test_identity_x_and_1_equals_NULL(self): + self.assertEqual(identity_conjunctive(1, 1), None) + if __name__ == "__main__": unittest.main()