Example #1
0
class TestCardClass(unittest.TestCase):
    def test_assign_value(self):
        self.card = Card(("K", "S", 1))
        self.assertEqual(self.card.value, 10)

    def test_flip_value(self):
        self.card = Card(("A", "H", 1))
        self.assertEqual(self.card.value, 11)
        self.card.flip_ace()
        self.assertEqual(self.card.value, 1)
        self.card.flip_ace()
        self.assertEqual(self.card.value, 11)

    def test_bad_ace(self):
        self.card = Card(("3", "C", 1))
        self.assertEqual(self.card.flip_ace(), "Not an ace!")
Example #2
0
 def test_flip_value(self):
     self.card = Card(("A", "H", 1))
     self.assertEqual(self.card.value, 11)
     self.card.flip_ace()
     self.assertEqual(self.card.value, 1)
     self.card.flip_ace()
     self.assertEqual(self.card.value, 11)
Example #3
0
 def test_assign_value(self):
     self.card = Card(("K", "S", 1))
     self.assertEqual(self.card.value, 10)
Example #4
0
 def test_bad_ace(self):
     self.card = Card(("3", "C", 1))
     self.assertEqual(self.card.flip_ace(), "Not an ace!")