def test_add_card2( self): #checks if function works with empty list and add card player1 = Player("ziv", 5000, 4) player1.playercards = [] card1 = Card(4, "Heart") player1.addCard(card1) self.assertTrue(len(player1.playercards) == 1)
def test_add_card3(self): #checks if function works with valid list player1 = Player("ziv", 5000, 4) player1.playercards = [] card1 = Card(4, "Heart") player1.playercards.append(card1) card2 = Card(7, "Heart") player1.addCard(card2) self.assertTrue(len(player1.playercards) == 2)
def test_add_card5( self): #checks that function not insert the same card twice player1 = Player("ziv", 5000, 4) player1.playercards = [] card1 = Card(4, "Heart") player1.playercards.append(card1) player1.addCard(card1) self.assertTrue(len(player1.playercards) == 1)
def test_add_card( self): #checks the function not works with full list of cards player1 = Player("ziv", 5000, 4) for i in range(5): card1 = Card(4, "Heart") player1.playercards.append(card1) player1.addCard(card1) self.assertTrue(len(player1.playercards) == 5)
def test_add_card4(self): #check the function not put it an invalid value player1 = Player("ziv", 5000, 4) player1.addCard(5) self.assertTrue(len(player1.playercards) == 0)