ADD file via upload

main
ppt527xkf 6 months ago
parent 03da2b4108
commit c4bc5963cc

@ -0,0 +1,21 @@
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()
Loading…
Cancel
Save