def test_four_card_score(self): hand = generate_hand([(2, SPADES), (3, SPADES), (4, SPADES), (5, SPADES)]) self.assertEqual(8, CribbageScorer(hand).tally_points())
def test_three_of_a_kind(self): hand = generate_hand([(4, HEARTS), (5, SPADES), (4, SPADES), (6, HEARTS)]) flip = Card(4, DIAMONDS) self.assertEqual(6, CribbageScorer(hand, flip).get_points_for_pairs())
def test_pairs(self): hand = generate_hand([(4, HEARTS), (2, CLUBS), (4, SPADES), (10, CLUBS)]) flip = Card(8, "Clubs") scorer = CribbageScorer(hand, flip) self.assertEqual(2, scorer.get_points_for_pairs())