Created
February 5, 2017 09:33
-
-
Save LiamJolly/419a3feec697cac14d8ae60bbe31f117 to your computer and use it in GitHub Desktop.
Unit test for the simple calculator functions.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import unittest | |
import simple_calc as sc | |
class SimpleCalcTest(unittest.TestCase): | |
def test_add(self): | |
result = sc.add(1, 2) | |
self.assertEqual(result, 3) | |
def test_subtract(self): | |
result = sc.subtract(2, 1) | |
self.assertEqual(result, 1) | |
def test_multiply(self): | |
result = sc.multiply(2, 2) | |
self.assertEqual(result, 4) | |
if __name__ == '__main__': | |
unittest.main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment