def test_deck_shuffle_changes_order(self): sut = deck() sut.shuffle() clean_deck = deck() match_count = 0 for i in range(0, len(sut.cards)): if sut.cards[i] == clean_deck.cards[i]: match_count += 1 self.assertNotEqual(52, match_count)
def test_deck_has_thirteen_cards_of_each_suit(self): sut = deck() self.assertEqual(4, len(card.SUITS)) for suit in card.SUITS: cardCount = 0 for deckCard in sut.cards: if deckCard.suit == suit: cardCount += 1 self.assertEqual(13, cardCount, msg="bad count for suit: %r" % suit)
def test_deck_has_four_value_cards_for_each_suit(self): sut = deck() self.assertEqual(13, len(card.VALUES)) for value in card.VALUES: cardCount = 0 for deckCard in sut.cards: if deckCard.value == value: cardCount += 1 self.assertEqual(4, cardCount, msg="bad count for value: %r" % value)
def __init__(self): self.deck = deck() self.current_hand = []
def test_deck_has_fifty_two_cards(self): sut = deck() self.assertEqual(52, len(sut.cards))