示例#1
0
class SampleTestCase(TestCase):

    def setUp(self):
        self.obj = SampleClassToBeTested(6, 3)

    def testThatNeverFails(self):
        self.assertTrue

    def testAddition(self):
        self.assertEqual(9, self.obj.add())

    def testSubstraction(self):
        self.assertEqual(3, self.obj.sub())

    def testMultiplication(self):
        self.assertEqual(18, self.obj.mult())

    def testDivision(self):
        self.assertEqual(2, self.obj.div())
示例#2
0
 def setUp(self):
     self.obj = SampleClassToBeTested(6, 3)