def test_figures_out_pair_is_best_rank(self): cards = [ Card(rank="Ace", suit="Spades"), Card(rank="Ace", suit="Clubs") ] validator = PairValidator(cards=cards) self.assertEqual(validator.is_valid(), True)
def test_validates_that_cards_have_a_pair(self): cards = [ Card(rank="Ace", suit="Diamonds"), Card(rank="Ace", suit="Hearts") ] validator = PairValidator(cards=cards) self.assertEqual(validator.is_valid(), True)
def test_validates_that_cards_have_exactly_one_pair(self): cards = [ Card(rank="Ace", suit="Spades"), Card(rank="Ace", suit="Clubs") ] validator = PairValidator(cards=cards) self.assertEqual(validator.is_valid(), True)
def test_valid_rank_is_pair(self): cards = [ Card(rank="5", suite="hearts"), Card(rank="7", suite="spades"), Card(rank="9", suite="clubs"), Card(rank="9", suite="diamonds"), Card(rank="King", suite="hearts") ] pair = PairValidator(cards=cards) self.assertEqual(pair.is_valid(), True)
def test_validates_that_cards_have_exectly_one_pair(self): cards = [Card(rank='8', suit='Diamonds'), Card(rank='8', suit='Clubs')] validator = PairValidator(cards=cards) self.assertEqual(validator.is_valid(), True)