Ejemplo n.º 1
0
 def test_for_number_of_valid_instance_of_card_after_deal_card(self):
     set_of_decks = SetOfDecks()
     card = set_of_decks.deal_card()
     '''since there are 8 instances of each card after
     after popping one 7 instances will remain
     '''
     self.assertEqual(set_of_decks.get_decks_list().count(card), 7)
Ejemplo n.º 2
0
 def test_distribute_card_first_time(self):
     current_players = []
     player1 = Player('Nikhil')
     player2 = Player('Nishant')
     current_players.append(player1)
     current_players.append(player2)
     set_of_decks = SetOfDecks()
     set_of_decks.get_decks_list().clear()
     set_of_decks.get_decks_list().append(Card('Spade', 'K'))
     set_of_decks.get_decks_list().append(Card('Spade', 'Q'))
     set_of_decks.get_decks_list().append(Card('Spade', '2'))
     set_of_decks.get_decks_list().append(Card('Spade', '3'))
     set_of_decks.get_decks_list().append(Card('Spade', '4'))
     set_of_decks.get_decks_list().append(Card('Spade', '5'))
     dealer = Dealer("IamDealer")
     dealer.distribute_card_first_time(current_players, set_of_decks)
     temp_list = []
     for card in player1.get_my_cards():
         temp_list.append(card.get_face_val())
     for card in player2.get_my_cards():
         temp_list.append(card.get_face_val())
     for card in dealer.get_my_cards():
         temp_list.append(card.get_face_val())
     self.assertEqual(temp_list, ['K', 'Q', '2', '3', '4', 0])
Ejemplo n.º 3
0
 def test_number_of_cards_in_set_of_deck(self):
     set_of_decks = SetOfDecks()
     self.assertEqual(len(set_of_decks.get_decks_list()), 416)