예제 #1
0
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 = ResetStatModsDelegate()
        
    def userReset(self):
        """ Test that the user's statmods are reset """
        for stat in self.user.statMods:
            self.user.statMods[stat] = 3
            
        self.delegate.applyEffect(self.user, self.target, None)
        
        for stat in self.user.statMods:
            assert self.user.statMods[stat] == 0, "Stat Mod should be reset to zero"
        
    def targetReset(self):
        """ Test that the target's statmods are reset """
        for stat in self.target.statMods:
            self.target.statMods[stat] = 3
            
        self.delegate.applyEffect(self.user, self.target, None)
        
        for stat in self.target.statMods:
            assert self.target.statMods[stat] == 0, "Stat Mod should be reset to zero"
        
    def message(self):
        """ Test that the proper message is returned """
        messages = self.delegate.applyEffect(self.user, self.target, None)
        
        assert messages == [ResetStatModsDelegate.message], "Should get the delegate's message"
예제 #2
0
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 = ResetStatModsDelegate()

    def userReset(self):
        """ Test that the user's statmods are reset """
        for stat in self.user.statMods:
            self.user.statMods[stat] = 3

        self.delegate.applyEffect(self.user, self.target, None)

        for stat in self.user.statMods:
            assert self.user.statMods[
                stat] == 0, "Stat Mod should be reset to zero"

    def targetReset(self):
        """ Test that the target's statmods are reset """
        for stat in self.target.statMods:
            self.target.statMods[stat] = 3

        self.delegate.applyEffect(self.user, self.target, None)

        for stat in self.target.statMods:
            assert self.target.statMods[
                stat] == 0, "Stat Mod should be reset to zero"

    def message(self):
        """ Test that the proper message is returned """
        messages = self.delegate.applyEffect(self.user, self.target, None)

        assert messages == [ResetStatModsDelegate.message
                            ], "Should get the delegate's message"
예제 #3
0
    def setUp(self):
        """ Build the Pkmn and Delegate for the test """
        self.user = BuildPokemonBattleWrapper()
        self.target = BuildPokemonBattleWrapper()

        self.delegate = ResetStatModsDelegate()
예제 #4
0
 def  setUp(self):
     """ Build the Pkmn and Delegate for the test """
     self.user = BuildPokemonBattleWrapper()
     self.target = BuildPokemonBattleWrapper()
     
     self.delegate = ResetStatModsDelegate()