def test_add(self): result = Example.add(self, 10, 6) self.assertEqual(result, 16) self.assertEqual(Example.add(self, 19, 6), 25) self.assertEqual(Example.add(self, 60, 20), 80) self.assertEqual(Example.add(self, 60, 20), 80)
def test_add( self ): # test method is used to see the test result/test run [recognized by python] if use check_add() it gives "empty suite ran 0 test..." result = Example.add(self, 10, 20) self.assertEqual(result, 30) self.assertEqual(Example.add(self, 0, 3), 3) self.assertEqual(Example.add(self, -10, 3), -7) self.assertEqual(Example.add(self, 200, 400), 600)
def test_add(self): result = Example.add(self, 10, 20) self.assertEqual(result, 30) self.assertEqual(Example.add(self, 10, 20), 30) # Second variant of writing self.assertEqual(Example.add(self, 0, 0), 0) # Second variant of writing self.assertEqual(Example.add(self, -1, 1), 0) # Second variant of writing
def test_add(self): result=Example.add(self,10,15) self.assertEqual(result, 25) print("Addition assertion successfull")
def test_add(self): # Always name your unit tests starting with the word, "test". self.assertEqual(Example.add(self, 10, 20), 30) self.assertEqual(Example.add(self, 0, 0), 0) self.assertEqual(Example.add(self, -1, 1), 0)
def test_add_fail(self): result = Example.add(self, 5, 6) # Fail self.assertEqual(result, 17)
def test_add_pass(self): result = Example.add(self, 5, 6) # Passing self.assertEqual(result, 11)
def test_add(self): self.assertEqual(Example.add(self, 10, 20), 30) self.assertEqual(Example.add(self, 0, 0), 0) self.assertEqual(Example.add(self, -1, 1), 0)
def test_add(self): result = Example.add(self,10, 20) self.assertEqual(result, 30) print("This is addition")
def test_add(self): result = Example.add(self, 10, 20) self.assertEqual(result, 30)
def test_add_1(self): self.assertEqual(Example.add(self, 10, 40), 50) self.assertEqual(Example.add(self, 100, 100), 200)
def test_add(self): self.assertEqual(Example.add(self, 10, 20), 30) self.assertEqual(Example.add(self, 22, 20), 42)
def test_anotherWayToTestAdd(self): self.assertEqual(Example.add(self, 0, 0), 0) self.assertEqual(Example.add(self, -1, 1), 0)