From 6eac7fac3f842cadb88b068635e17a79108897f6 Mon Sep 17 00:00:00 2001 From: Haidong Ji Date: Fri, 28 Dec 2018 18:05:45 -0600 Subject: Max expression value by placing paren done! --- .../tests/placing_parenTest.py | 32 ++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 AlgoDesignAndTechniqueEdxPython/tests/placing_parenTest.py (limited to 'AlgoDesignAndTechniqueEdxPython/tests/placing_parenTest.py') diff --git a/AlgoDesignAndTechniqueEdxPython/tests/placing_parenTest.py b/AlgoDesignAndTechniqueEdxPython/tests/placing_parenTest.py new file mode 100644 index 0000000..7463182 --- /dev/null +++ b/AlgoDesignAndTechniqueEdxPython/tests/placing_parenTest.py @@ -0,0 +1,32 @@ +''' +Created on Dec 28, 2018 + +@author: haidong +''' +import unittest + +from sources.placing_paren import getMaxValue + + +class Test(unittest.TestCase): + + def testName(self): + exp = "1+5" + self.assertEqual(6, getMaxValue(exp)) + + def testName1(self): + exp = "5-8+7*4-8+9" + self.assertEqual(200, getMaxValue(exp)) + + def testName2(self): + exp = "1+2-3*4-5" + self.assertEqual(6, getMaxValue(exp)) + + def testName3(self): + exp = "1+2*3" + self.assertEqual(9, getMaxValue(exp)) + + +if __name__ == "__main__": + # import sys;sys.argv = ['', 'Test.testName'] + unittest.main() -- cgit v1.2.3