Example #1
0
class calcDamage(unittest.TestCase):
    """ Test cases of calcDamage """
    def setUp(self):
        """ Build the Delegate and Pkmn for the test """
        self.user = BuildPokemonBattleWrapper()
        self.target = BuildPokemonBattleWrapper()

        self.damage = 40
        self.delegate = FixedDelegate(None, self.damage, 1)

    def fixed(self):
        """ Test that the damage returned is the fixed amount """
        self.user.statMods["ATK"] = 0
        damage = self.delegate.calcDamage(self.user, self.target)
        assert damage == self.damage, "Damage should be the fixed amount"

    def fixedWithStatMod(self):
        """ Test that the damage returned is fixed even with a stat mod """
        self.user.statMods["ATK"] = 3
        damage = self.delegate.calcDamage(self.user, self.target)
        assert damage == self.damage, "Damage should be the fixed amount"
Example #2
0
class calcDamage(unittest.TestCase):
    """ Test cases of calcDamage """
    
    def  setUp(self):
        """ Build the Delegate and Pkmn for the test """
        self.user = BuildPokemonBattleWrapper()
        self.target = BuildPokemonBattleWrapper()
        
        self.damage = 40
        self.delegate = FixedDelegate(None, self.damage, 1)
        
    def fixed(self):
        """ Test that the damage returned is the fixed amount """
        self.user.statMods["ATK"] = 0
        damage =  self.delegate.calcDamage(self.user, self.target)
        assert damage == self.damage, "Damage should be the fixed amount"
        
    def fixedWithStatMod(self):
        """ Test that the damage returned is fixed even with a stat mod """
        self.user.statMods["ATK"] = 3
        damage =  self.delegate.calcDamage(self.user, self.target)
        assert damage == self.damage, "Damage should be the fixed amount"