Esempio n. 1
0
    def test_assess_damage_max_health_add_damage_in_case_of_repair_ship(self):
        # Arrange
        name = 'NShip'
        type_ = 'Battle'
        align = 'them'
        x_location = 2
        y_location = 2
        amount_of_damage = 10

        # Act
        ship = Ship(name, type_, x_location, y_location, align)
        ship._current_health = 100
        ship._max_health = 100

        ship.assess_damage(amount_of_damage)

        # Assert
        self.assertEqual(100, ship._current_health)
Esempio n. 2
0
    def test_assess_damage_current_health_zero_ship_destroyed(self):
        # Arrange
        name = 'NShip'
        type_ = 'Battle'
        align = 'them'
        x_location = 2
        y_location = 2
        amount_of_damage = -10

        # Act
        ship = Ship(name, type_, x_location, y_location, align)
        ship._current_health = 0
        ship._max_health = 100

        ship.assess_damage(amount_of_damage)

        # Assert
        self.assertEqual(0, ship._current_health)