コード例 #1
0
    def test_make_attack_misses(self, mockRoll):
        attacker_dial = Dial(self.attacker_dial_data)
        target_dial = Dial(self.target_dial_data)
        mockRoll.return_value = 12  # will hit
        attack_roll = attacker_dial.roll_to_hit(target_dial)
        if attack_roll:
            attack_damage = attacker_dial.calculate_damage()
            target_dial.add_damage(attack_damage)

        self.assertTrue(attack_roll)
コード例 #2
0
 def test_make_attack_hits(self, mockRoll):
     attacker_dial = Dial(self.attacker_dial_data)
     target_dial = Dial(self.target_dial_data)
     mockRoll.return_value = 2  # will miss
     attack_roll = attacker_dial.roll_to_hit(target_dial)
     self.assertFalse(attack_roll)