Пример #1
0
 def  setUp(self):
     """ Build the Pkmn and Delegate for the test """
     self.pkmn = BuildPokemonBattleWrapper()
     
     self.ratio = 2
     self.damage = 10
     self.delegate = HealByDamageRatioDelegate(self.ratio)
Пример #2
0
class heal(unittest.TestCase):
    """ Test cases of heal """
    
    def  setUp(self):
        """ Build the Pkmn and Delegate for the test """
        self.pkmn = BuildPokemonBattleWrapper()
        
        self.ratio = 2
        self.damage = 10
        self.delegate = HealByDamageRatioDelegate(self.ratio)
        
    def heal(self):
        """ Test that it heals by the ratio of the damage done """
        self.pkmn.setCurrHP(0)
        self.delegate.damage = self.damage
        self.delegate.heal(self.pkmn)
        
        hp = self.pkmn.getCurrHP()
        heal = self.damage/self.ratio
        assert hp == heal, "Should be healed by the ratio of the damage"