Beispiel #1
0
    def test_health_points_invalid_data_should_raise_error(self):
        card = TrapCard("TestCard")

        with self.assertRaises(ValueError):
            card.health_points = -1
Beispiel #2
0
 def test_health_points_raises(self):
     card = TrapCard('test')
     with self.assertRaises(ValueError) as ex:
         card.health_points = -2
     self.assertEqual(str(ex.exception),
                      "Card's HP cannot be less than zero.")
Beispiel #3
0
    def test_health_points_valid_data_should_work_correctly(self):
        card = TrapCard("TestCard")
        card.health_points = 8

        self.assertEqual(card.health_points, 8)
Beispiel #4
0
 def test_health_point_raise_exemption_when_less_than_0(self):
     with self.assertRaises(Exception) as ex:
         trap_card = TrapCard('test')
         trap_card.health_points = -5
     self.assertIsNotNone(ex.exception)
 def test_set_health_negative_value_raises(self):
     a = TrapCard("Test")
     with self.assertRaises(ValueError):
         a.health_points = -10
Beispiel #6
0
 def test_add_health_points(self):
     new_card = TrapCard("KOZA")
     new_card.health_points = 62
     self.assertEqual(new_card.health_points, 62)
Beispiel #7
0
 def test_health_setter(self):
     card = TrapCard('test')
     card.health_points = 15
     self.assertEqual(15, card.health_points)