Ejemplo n.º 1
0
 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)
Ejemplo n.º 2
0
 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)
Ejemplo n.º 3
0
 def test_get_card3(self):
     player1 = Player("ziv", 5000, 4)
     player1.playercards = []
     for i in range(4):
         card1 = Card(4, "Heart")
         player1.playercards.append(card1)
     player1.getCard()
     self.assertTrue(len(player1.playercards) == 3)
Ejemplo n.º 4
0
 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)
Ejemplo n.º 5
0
 def test_get_card2(
         self
 ):  #checks that the function not work with more than 5 cards list
     player1 = Player("ziv", 5000, 4)
     player1.playercards = []
     for i in range(6):
         card1 = Card(4, "Heart")
         player1.playercards.append(card1)
     player1.getCard()
     self.assertTrue(len(player1.playercards) == 6)
Ejemplo n.º 6
0
 def test_get_card(
         self):  #checks that the function not work with empty list
     player1 = Player("ziv", 5000, 4)
     player1.playercards = []
     player1.getCard()
     self.assertTrue(len(player1.playercards) == 0)