|
@ -0,0 +1,50 @@ |
|
|
|
|
|
import unittest |
|
|
|
|
|
from src.main.py.logical_operations import * |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class calculationsWithRoots(unittest.TestCase): |
|
|
|
|
|
def setUp(self): |
|
|
|
|
|
pass |
|
|
|
|
|
|
|
|
|
|
|
def tearDown(self): |
|
|
|
|
|
pass |
|
|
|
|
|
|
|
|
|
|
|
def test_identity_1_or_0_equals_1(self): |
|
|
|
|
|
self.assertEqual(identity(1, "+", 0), 1) |
|
|
|
|
|
|
|
|
|
|
|
def test_identity_1_or_1_equals_None(self): |
|
|
|
|
|
self.assertEqual(identity(1, "+", 1), None) |
|
|
|
|
|
|
|
|
|
|
|
def test_identity_0_or_1_equals_1(self): |
|
|
|
|
|
self.assertEqual(identity(0, "+", 1), 1) |
|
|
|
|
|
|
|
|
|
|
|
def test_identity_0_or_0_equals_0(self): |
|
|
|
|
|
self.assertEqual(identity(0, "+", 0), 0) |
|
|
|
|
|
|
|
|
|
|
|
def test_identity_0_and_0_equals_None(self): |
|
|
|
|
|
self.assertEqual(identity(0, ".", 0), None) |
|
|
|
|
|
|
|
|
|
|
|
def test_identity_1_and_0_equals_0(self): |
|
|
|
|
|
self.assertEqual(identity(1, ".", 0), 0) |
|
|
|
|
|
|
|
|
|
|
|
def test_identity_0_and_1_equals_0(self): |
|
|
|
|
|
self.assertEqual(identity(0, ".", 1), 0) |
|
|
|
|
|
|
|
|
|
|
|
def test_identity_1_and_1_equals_1(self): |
|
|
|
|
|
self.assertEqual(identity(1, ".", 1), 1) |
|
|
|
|
|
|
|
|
|
|
|
def test_one_zero_1_or_1_equals_1(self): |
|
|
|
|
|
self.assertEqual(one_zero(1, 1), 1) |
|
|
|
|
|
|
|
|
|
|
|
def test_one_zero_0_or_1_equals_1(self): |
|
|
|
|
|
self.assertEqual(one_zero(0, 1), 1) |
|
|
|
|
|
|
|
|
|
|
|
def test_one_zero_1_or_0_equals_1(self): |
|
|
|
|
|
self.assertEqual(one_zero(1, 0), 1) |
|
|
|
|
|
|
|
|
|
|
|
def test_one_zero_0_or_0_equals_None(self): |
|
|
|
|
|
self.assertEqual(one_zero(0, 0), None) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == "__main__": |
|
|
|
|
|
unittest.main() |