def test_incorrect_guess(self):
     card = Card("What is the capital of Alaska?", "Juneau", "Geography")
     turn = Turn("Topeka", card)
     self.assertEqual(turn.card, card)
     self.assertEqual(turn.guess, "Topeka")
     self.assertFalse(turn.is_correct())
     self.assertEqual(turn.feedback(), "Incorrect")
 def test_correct_guess(self):
     card = Card("What is the capital of Alaska?", "Juneau", "Geography")
     turn = Turn("Juneau", card)
     self.assertEqual(turn.card, card)
     self.assertEqual(turn.guess, "Juneau")
     self.assertTrue(turn.is_correct())
     self.assertEqual(turn.feedback(), "Correct!")
Example #3
0
 def take_turn(self, guess):
     turn = Turn(guess, self.current_card())
     self.turns.append(turn)
     if turn.is_correct():
         self.number_correct += 1
     return turn