def test_expected(self):
        full_house_hand = Hand(
            [
                Two(Suit.Hearts),
                Two(Suit.Clubs),
                Two(Suit.Diamonds),
                Three(Suit.Clubs),
                Three(Suit.Diamonds)
            ]
        )

        self.assertTrue(FullHouseVerifier.verify_hand_ranking(full_house_hand))

        four_of_a_kind_hand = Hand(
            [
                Two(Suit.Diamonds),
                Two(Suit.Clubs),
                Two(Suit.Hearts),
                Two(Suit.Spades),
                Three(Suit.Hearts)
            ]
        )

        self.assertFalse(FullHouseVerifier.verify_hand_ranking(four_of_a_kind_hand))

        three_of_a_kind_hand = Hand(
            [
                Two(Suit.Hearts),
                Two(Suit.Clubs),
                Two(Suit.Diamonds),
                Three(Suit.Clubs),
                Four(Suit.Diamonds)
            ]
        )

        self.assertFalse(FullHouseVerifier.verify_hand_ranking(three_of_a_kind_hand))

        two_of_a_kind_hand = Hand(
            [
                Ace(Suit.Hearts),
                Two(Suit.Clubs),
                Six(Suit.Diamonds),
                Three(Suit.Clubs),
                Three(Suit.Diamonds)
            ]
        )

        self.assertFalse(FullHouseVerifier.verify_hand_ranking(two_of_a_kind_hand))
 def calculate_hand_ranking(hand):
     if StraightFlushVerifier.verify_hand_ranking(hand):
         return StraightFlushCalculator.calculate_hand_ranking(hand)
     else:
         if FourOfAKindVerifier.verify_hand_ranking(hand):
             return FourOfAKindCalculator.calculate_hand_ranking(hand)
         else:
             if FullHouseVerifier.verify_hand_ranking(hand):
                 return FullHouseCalculator.calculate_hand_ranking(hand)
             else:
                 if FlushVerifier.verify_hand_ranking(hand):
                     return FlushCalculator.calculate_hand_ranking(hand)
                 else:
                     if StraightVerifier.verify_hand_ranking(hand):
                         return StraightCalculator.calculate_hand_ranking(hand)
                     else:
                         if ThreeOfAKindVerifier.verify_hand_ranking(hand):
                             return ThreeOfAKindCalculator.calculate_hand_ranking(hand)
                         else:
                             if TwoPairVerifier.verify_hand_ranking(hand):
                                 return TwoPairCalculator.calculate_hand_ranking(hand)
                             else:
                                 if OnePairVerifier.verify_hand_ranking(hand):
                                     return OnePairCalculator.calculate_hand_ranking(hand)
                                 else:
                                     if HighCardVerifier.verify_hand_ranking(hand):
                                         return HighCardCalculator.calculate_hand_ranking(hand)
                                     else:
                                         raise RuntimeError("unknown hand ranking")
 def calculate_hand_ranking(hand):
     if FullHouseVerifier.verify_hand_ranking(hand):
         card_values = [card.value for card in hand.cards]
         card_counter = Counter(card_values)
         if 3 == card_counter[card_values[0]]:
             three_of_a_kind_value = card_values[0]
             two_of_a_kind_value = [card.value for card in hand.cards if card.value != three_of_a_kind_value][0]
         else:
             two_of_a_kind_value = card_values[0]
             three_of_a_kind_value = [card.value for card in hand.cards if card.value != two_of_a_kind_value][0]
         return FullHouse(three_of_a_kind_value, two_of_a_kind_value)
     else:
         raise RuntimeError("hand is not full house")