Browse Source

Added another testcase for identity and additions in code to fulfill it

remotes/origin/feature/feature-logical-operations
fdai7783 11 months ago
parent
commit
49d130a2b1
  1. 3
      src/main/py/logical_operations.py
  2. 3
      src/test/py/test_logical_operations.py

3
src/main/py/logical_operations.py

@ -1,2 +1,5 @@
def identity_conjunctive(variable, zero):
if variable == 1 and zero == 0:
return variable
else:
return None

3
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()
Loading…
Cancel
Save