Example #1
0
    def test_validates_that_cards_have_two_of_the_same_rank_and_three_of_another_rank(self):
        validator = FullHouseValidator(cards = self.cards)

        self.assertEqual(
            validator.is_valid(),
            True
        )
    def test_returns_collection_of_two_cards_of_the_same_rank_and_three_card_of_the_same_rank(
            self):
        validator = FullHouseValidator(cards=self.cards)

        self.assertEqual(validator.valid_cards(), [
            self.three_of_clubs, self.three_of_hearts, self.three_of_spades,
            self.nine_of_diamonds, self.nine_of_spades
        ])
 def test_is_valid(self):
     '''
     full house is when there is 3 card of same rank
     and 2 card of same rank
     1 "three of a kind" and 1 "pair"
     '''
     validator = FullHouseValidator(cards = self.cards)
 
     self.assertEqual(
         validator.is_valid(),
         True
     )
 def test_valid_cards(self):
     validator = FullHouseValidator(cards = self.cards)
 
     self.assertEqual(
         validator.valid_cards(),
         [
         self.two_of_diamonds,
         self.two_of_spades,
         self.four_of_clubs,
         self.four_of_diamonds,
         self.four_of_hearts,   
         ]
     )
 def test_returns_a_full_house_from_card_collection(self):
     validator = FullHouseValidator(cards=self.cards)
     self.assertEqual(validator.valid_cards(), [
         self.four_of_hearts, self.four_of_spades, self.eight_of_clubs,
         self.eight_of_hearts, self.eight_of_spades
     ])
    def test_validates_that_cards_have_a_full_house(self):
        validator = FullHouseValidator(cards=self.cards)

        self.assertEqual(validator.is_valid(), True)