Esempio n. 1
0
 def CardIsPlayable(self, card):
     c = Card(card)
     if self.piles[c.GetSuit()] + 1 == c.GetValue():
         return True
     else:
         return False
Esempio n. 2
0
 def testValidCardNumber(self):
     testCard0 = Card(3, "Spades")
     self.assertEqual(testCard0.GetSuit(), "Spades",
                      "Failed constructing correct suit 3 of spades")
     self.assertEqual(testCard0.GetValue(), 3,
                      "Failed constructing correct suit 3 of spades")
Esempio n. 3
0
 def testValidAce(self):
     testCard4 = Card(14, "Clubs")  #Ace or 14
     self.assertEqual(testCard4.GetSuit(), "Clubs",
                      "Failed constructing correct suit Ace of Clubs")
     self.assertEqual(testCard4.GetValue(), 14,
                      "Failed constructing correct suit Ace of Clubs")
Esempio n. 4
0
 def testValidKingFace(self):
     testCard3 = Card(13, "Diamonds")  #King
     self.assertEqual(testCard3.GetSuit(), "Diamonds",
                      "Failed constructing correct suit King of Diamonds")
     self.assertEqual(testCard3.GetValue(), 13,
                      "Failed constructing correct suit King of Diamonds")
Esempio n. 5
0
 def testValidQueenFace(self):
     testCard2 = Card(12, "Hearts")  #Queen
     self.assertEqual(testCard2.GetSuit(), "Hearts",
                      "Failed constructing correct suit Queen of Hearts")
     self.assertEqual(testCard2.GetValue(), 12,
                      "Failed constructing correct suit Queen of Hearts")
Esempio n. 6
0
 def testValidJackFace(self):
     testCard1 = Card(11, "Spades")  #Jack
     self.assertEqual(testCard1.GetSuit(), "Spades",
                      "Failed constructing correct suit Jack of spades")
     self.assertEqual(testCard1.GetValue(), 11,
                      "Failed constructing correct suit Jack of spades")