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!")
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_assign_value(self): self.card = Card(("K", "S", 1)) self.assertEqual(self.card.value, 10)
def test_bad_ace(self): self.card = Card(("3", "C", 1)) self.assertEqual(self.card.flip_ace(), "Not an ace!")