You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
590 B
21 lines
590 B
import unittest
|
|
from character import Character
|
|
|
|
class TestCharacter(unittest.TestCase):
|
|
def test_initial_health(self):
|
|
character = Character()
|
|
self.assertEqual(character.health, 100)
|
|
|
|
def test_move_forward(self):
|
|
character = Character()
|
|
character.move('forward')
|
|
self.assertEqual(character.position, (0, 1))
|
|
|
|
def test_heal(self):
|
|
character = Character()
|
|
character.take_damage(50)
|
|
character.heal(30)
|
|
self.assertEqual(character.health, 80)
|
|
|
|
if __name__ == "__main__":
|
|
unittest.main() |