Пример #1
0
 def teste_ground_clash(self):
     red_bird = RedBird(0, 0)
     red_bird.ground_clash()
     self.assertEqual(DESTROYED, red_bird.status, 'Must clash with ground once y<=0')
     red_bird = RedBird(1, 0)
     red_bird.ground_clash()
     self.assertEqual(DESTROYED, red_bird.status, 'Must clash with ground once y<=0')
     red_bird = RedBird(2, 0)
     red_bird.ground_clash()
     self.assertEqual(DESTROYED, red_bird.status, 'Must clash with ground once y<=0')
     red_bird = RedBird(2, -0.1)
     red_bird.ground_clash()
     self.assertEqual(DESTROYED, red_bird.status, 'Must clash with ground once y<=0')
     red_bird = RedBird(2, -5)
     red_bird.ground_clash()
     self.assertEqual(DESTROYED, red_bird.status, 'Must clash with ground once y<=0')
Пример #2
0
 def teste_colisao_com_chao(self):
     """
     Testando que o passáro colido quando sua posição y é menor ou igual a 0
     :return:
     """
     passaro = RedBird(0, 0)
     passaro.ground_clash()
     self.assertEqual(DESTROYED, passaro.status, 'Deve colidir com chão sempre que y<=0')
     passaro = RedBird(1, 0)
     passaro.ground_clash()
     self.assertEqual(DESTROYED, passaro.status, 'Deve colidir com chão sempre que y<=0')
     passaro = RedBird(2, 0)
     passaro.ground_clash()
     self.assertEqual(DESTROYED, passaro.status, 'Deve colidir com chão sempre que y<=0')
     passaro = RedBird(2, -0.1)
     passaro.ground_clash()
     self.assertEqual(DESTROYED, passaro.status, 'Deve colidir com chão sempre que y<=0')
     passaro = RedBird(2, -5)
     passaro.ground_clash()
     self.assertEqual(DESTROYED, passaro.status, 'Deve colidir com chão sempre que y<=0')