def test_status(self): phase = Phase() pigs = [Pig(1, 1) for i in range(2)] birds = [YellowBird(1, 1) for i in range(2)] phase.add_pigs(*pigs) phase.add_birds(*birds) self.assertEqual(ON_GOING, phase.status()) for bird, pig in zip(birds, pigs): bird.clash(pig, 3) self.assertEqual(VICTORY, phase.status(), 'Without active pigs game should end with victory') phase.add_obstacles(Obstacle()) self.assertEqual(VICTORY, phase.status(), 'Obstacle must not interfere on game result') pig = Pig() phase.add_pigs(pig) self.assertEqual(DEFEAT, phase.status(), 'With Active Pig and with no Active bird, game should end with defeat') phase.add_birds(YellowBird()) self.assertEqual(ON_GOING, phase.status(), 'With active pig and birds, game should not end') pig.clash(pig, 3) self.assertEqual(VICTORY, phase.status(), 'Without active pigs game should end with victory')
def teste_status(self): fase = Phase() porcos = [Pig(1, 1) for i in range(2)] passaros = [YellowBird(1, 1) for i in range(2)] fase.add_pigs(*porcos) fase.add_birds(*passaros) self.assertEqual(ON_GOING, fase.status()) for passaro, porco in zip(passaros, porcos): passaro.clash(porco, 3) self.assertEqual(VICTORY, fase.status(), 'Sem porcos ativos o jogo deveria terminar com vitória') fase.add_obstacles(Obstacle()) self.assertEqual(VICTORY, fase.status(), 'Obstáculo não interfere para definir vitória') porco = Pig() fase.add_pigs(porco) self.assertEqual(DEFEAT, fase.status(), 'Com Pig ativo e sem pássaro para lançar, o jogo deveria acabar em derrota') fase.add_birds(YellowBird()) self.assertEqual(ON_GOING, fase.status(), 'Com Pig ativo e com pássaro para lançar, o jogo não deveria acabar') porco.clash(porco, 3) self.assertEqual(VICTORY, fase.status(), 'Sem porco ativo, o jogo deveria acabar com vitória')
def test_status(self): phase = Phase() pigs = [Pig(1, 1) for i in range(2)] birds = [YellowBird(1, 1) for i in range(2)] phase.add_pigs(*pigs) phase.add_birds(*birds) self.assertEqual(ON_GOING, phase.status()) for bird, pig in zip(birds, pigs): bird.clash(pig, 3) self.assertEqual(VICTORY, phase.status(), 'Without active pigs game should end with victory') phase.add_obstacles(Obstacle()) self.assertEqual(VICTORY, phase.status(), 'Obstacle must not interfere on game result') pig = Pig() phase.add_pigs(pig) self.assertEqual( DEFEAT, phase.status(), 'With Active Pig and with no Active bird, game should end with defeat' ) phase.add_birds(YellowBird()) self.assertEqual(ON_GOING, phase.status(), 'With active pig and birds, game should not end') pig.clash(pig, 3) self.assertEqual(VICTORY, phase.status(), 'Without active pigs game should end with victory')
def test_status(self): pig = Pig() self.assertEqual('@', pig.character()) actor_on_same_position = Actor() pig.clash(actor_on_same_position) self.assertEqual('+', pig.character())
def teste_status(self): porco = Pig() self.assertEqual('@', porco.character()) outro_ator_na_mesma_posicao = Actor() porco.clash(outro_ator_na_mesma_posicao) self.assertEqual('+', porco.character())