Exemplo n.º 1
0
    def test_is_straight_should_return_true_if_cards_are_ordered(self):
        card1 = Card(DeckSuite.TILES, DeckValue.SIX)
        card2 = Card(DeckSuite.TILES, DeckValue.SEVEN)
        card3 = Card(DeckSuite.HEARTS, DeckValue.EIGHT)
        card4 = Card(DeckSuite.TILES, DeckValue.NINE)
        card5 = Card(DeckSuite.CLOVERS, DeckValue.TEN)
        self.assertTrue(
            HandsHelper.is_straight(card1, card2, card3, card4, card5))

        card6 = Card(DeckSuite.TILES, DeckValue.TEN)
        card7 = Card(DeckSuite.TILES, DeckValue.JACK)
        card8 = Card(DeckSuite.HEARTS, DeckValue.QUEEN)
        card9 = Card(DeckSuite.TILES, DeckValue.KING)
        card10 = Card(DeckSuite.CLOVERS, DeckValue.ACE)
        self.assertTrue(
            HandsHelper.is_straight(card6, card7, card8, card9, card10))
Exemplo n.º 2
0
 def test_is_straight_should_return_false(self):
     card1 = Card(DeckSuite.TILES, DeckValue.TWO)
     card2 = Card(DeckSuite.TILES, DeckValue.THREE)
     card3 = Card(DeckSuite.TILES, DeckValue.EIGHT)
     card4 = Card(DeckSuite.TILES, DeckValue.NINE)
     card5 = Card(DeckSuite.CLOVERS, DeckValue.ACE)
     self.assertFalse(
         HandsHelper.is_straight(card1, card2, card3, card4, card5))