import unittest class MyTest(unittest.TestCase): def test0(self): self.assertEqual(add(4,3), 7) def test1(self): self.assertEqual(add(5,1), 6) def test2(self): self.assertEqual(add(81,78), 159) def test3(self): self.assertEqual(add(21,9), 30) def test4(self): self.assertEqual(add(7,5), 12) def test5(self): self.assertEqual(add(50, 50), 100) if __name__ == '__main__': unittest.main()
- import unittest
- class MyTest(unittest.TestCase):
- def test0(self):
self.assertEqual(add(3,4), 7)- self.assertEqual(add(4,3), 7)
- def test1(self):
self.assertEqual(add(1,5), 6)- self.assertEqual(add(5,1), 6)
- def test2(self):
self.assertEqual(add(78,81), 159)- self.assertEqual(add(81,78), 159)
- def test3(self):
self.assertEqual(add(9,21), 30)- self.assertEqual(add(21,9), 30)
- def test4(self):
self.assertEqual(add(5,7), 12)- self.assertEqual(add(7,5), 12)
- def test5(self):
- self.assertEqual(add(50, 50), 100)
- if __name__ == '__main__':