示例#1
0
 def test_should_subtract_attack_power_amount_from_health(self, mock_unit):
     receiver = UnitBase()
     receiver.position = mock.Mock()
     receiver._health = 5
     mock_unit.return_value = receiver
     self.attack.perform()
     self.assertEqual(receiver.health, 2)
示例#2
0
 def test_should_subtract_100_health_from_each_unit_on_the_floor(self):
     unit = UnitBase()
     unit._health = 20
     self.floor.add(unit, 0, 1)
     self.captive._health = 10
     self.explode.perform()
     self.assertEqual(self.captive.health, -90)
     self.assertEqual(unit.health, -80)
示例#3
0
 def test_should_subtract_100_health_from_each_unit_on_the_floor(self):
     unit = UnitBase()
     unit._health = 20
     self.floor.add(unit, 0, 1)
     self.captive._health = 10
     self.explode.perform()
     self.assertEqual(self.captive.health, -90)
     self.assertEqual(unit.health, -80)