コード例 #1
0
ファイル: test_game.py プロジェクト: airskyler/UnitTestPart2
    def test_compareNotEqual(self):

        the_game = blue()
        the_game.numberUser = 15  ##  give user a higher number than a computer number to test
        the_game.number = 14
        self.assertEqual(the_game.compareNum(), -1, "The number is too high")
コード例 #2
0
ファイル: test_game.py プロジェクト: airskyler/UnitTestPart2
    def test_compareNotEqualA(self):

        the_game = blue()
        the_game.numberUser = 10  ##  give the user number lower than a computer number to test
        the_game.number = 14
        self.assertEqual(the_game.compareNum(), 1, "The number is too low")
コード例 #3
0
ファイル: test_game.py プロジェクト: airskyler/UnitTestPart2
    def test_compareNum(self):

        the_game = blue()
        the_game.numberUser = 15  ##  give a user and computer a same number to test the equality
        the_game.number = 15
        self.assertEqual(the_game.compareNum(), 0, "The number is same")