Esempio n. 1
0
 def test_validates_that_cards_have_a_flush(self):
     validator = FlushValidator(cards = self.cards)
 
     self.assertEqual(
         validator.is_valid(),
         True
     )
Esempio n. 2
0
    def test_returns_the_five_highest_cards_with_the_same_suit(self):
        validator = FlushValidator(cards=self.cards)

        self.assertEqual(validator.valid_cards(), [
            self.five_of_hearts, self.seven_of_hearts, self.eight_of_hearts,
            self.ten_of_hearts, self.ace_of_hearts
        ])
 def test_to_figure_flush_is_best_rank(self):
     '''
     flush is when min 5 cards
     have same suite
     '''
     validator = FlushValidator(cards=self.cards)
     self.assertEqual(validator.is_valid(), True)
    def test_validates_that_five_cards_of_same_suit_exist_in_collection(self):
        validator = FlushValidator(cards=self.cards)

        self.assertEqual(
            validator.is_valid(),
            True
        )
Esempio n. 5
0
 def test_returns_a_flush_from_card_collection(self):
     validator = FlushValidator(cards = self.cards)
     self.assertEqual(
         validator.valid_cards(),
         [
             self.five_of_clubs,
             self.six_of_clubs,
             self.eight_of_clubs,
             self.ten_of_clubs,
             self.ace_of_clubs
         ]
     )
Esempio n. 6
0
    def test_does_not_figure_a_2_hand_card_as_Flush(self):
        two_cards = [
            Card(rank = "2", suit = "Spades"),
            Card(rank = "3", suit = "Spades")
        ]
        
        validator = FlushValidator(cards = two_cards)

        self.assertEqual(
            validator.is_valid(),
            False
        )
 def test_valid_cards(self):
     validator = FlushValidator(cards=self.cards)
     self.assertEqual(validator.valid_cards(), [
         self.three_of_hearts, self.four_of_hearts, self.five_of_hearts,
         self.ten_of_hearts, self.ace_of_hearts
     ])