コード例 #1
0
ファイル: dodge_test.py プロジェクト: cloew/Pokemon-Project
class applyEffect(unittest.TestCase):
    """ Test cases of applyEffect """
    
    def  setUp(self):
        """ Build the Pkmn and Delegate for the test """
        self.user = BuildPokemonBattleWrapper()
        self.target = BuildPokemonBattleWrapper()
        self.delegate = DodgeDelegate("DIG", "")
        
    def dodgeRemoved(self):
        """ Test that the dodge is removed when the attack's effect is applied """
        self.delegate.applyEffect(self.user, self.target, None)
        assert self.user.dodge == None, "User should no longer be dodging"
コード例 #2
0
ファイル: dodge_test.py プロジェクト: cloew/Pokemon-Project
class isCharging(unittest.TestCase):
    """ Test cases of isCharging """
    
    def  setUp(self):
        """ Build the Pkmn and Delegate for the test """
        self.user = BuildPokemonBattleWrapper()
        self.environment = BattleEnvironment()
        self.dodgeType = "DIG"
        self.delegate = DodgeDelegate(self.dodgeType, "")
        
    def dodging(self):
        """ Test that the dodge is set to the delegate's dodge type """
        assert self.user.dodge is None, "User should not be dodging"
        self.delegate.isCharging(self.user, self.environment)
        assert self.user.dodge == self.dodgeType, "User should get the delegate's dodge type"
コード例 #3
0
ファイル: dodge_test.py プロジェクト: cloew/Pokemon-Project
 def  setUp(self):
     """ Build the Pkmn and Delegate for the test """
     self.user = BuildPokemonBattleWrapper()
     self.target = BuildPokemonBattleWrapper()
     self.delegate = DodgeDelegate("DIG", "")
コード例 #4
0
ファイル: dodge_test.py プロジェクト: cloew/Pokemon-Project
 def  setUp(self):
     """ Build the Pkmn and Delegate for the test """
     self.user = BuildPokemonBattleWrapper()
     self.environment = BattleEnvironment()
     self.dodgeType = "DIG"
     self.delegate = DodgeDelegate(self.dodgeType, "")