Exemplo n.º 1
0
 def test_initialization(self):
     ship = Ship(10, 20)
     self.assertEqual(10, ship.x)
     self.assertEqual(20, ship.y)
     self.assertEqual(100, ship.health)
     self.assertEqual(0, ship.cool_down_counter)
     self.assertEqual(30, ship.COOLDOWN)
Exemplo n.º 2
0
 def test_get_height(self):
     ship = Ship(10, 20)
     ship.ship_img = pygame.image.load("./assets/pixel_ship_yellow.png")
     self.assertEqual(90, ship.get_height())
Exemplo n.º 3
0
 def test_shooting(self):
     ship = Ship(10, 20)
     ship.laser_img = pygame.image.load("./assets/pixel_laser_yellow.png")
     ship.shoot()
     self.assertEqual(1, ship.cool_down_counter)
Exemplo n.º 4
0
 def test_cooldown_35(self):
     ship = Ship(10, 20)
     ship.cool_down_counter = 35
     ship.cooldown()
     self.assertEqual(0, ship.cool_down_counter)
Exemplo n.º 5
0
 def test_cooldown_1(self):
     ship = Ship(10, 20)
     ship.cool_down_counter = 1
     ship.cooldown()
     self.assertEqual(2, ship.cool_down_counter)