summaryrefslogtreecommitdiff
path: root/22/test.py
diff options
context:
space:
mode:
Diffstat (limited to '22/test.py')
-rwxr-xr-x22/test.py39
1 files changed, 39 insertions, 0 deletions
diff --git a/22/test.py b/22/test.py
new file mode 100755
index 0000000..8410d32
--- /dev/null
+++ b/22/test.py
@@ -0,0 +1,39 @@
+#!/usr/bin/python
+
+import unittest
+
+import main
+
+
+
+class ExamplesPart1(unittest.TestCase):
+ def test_example1(self):
+ player = main.Entity()
+ player.health = 10
+ player.armour = 0
+ player.mana = 250
+
+ boss = main.Entity()
+ boss.health = 13
+ boss.damage = 8
+
+ result = main.solve_partn(1, player, boss)
+ self.assertEqual(result, 173 + 53)
+
+ def test_example2(self):
+ player = main.Entity()
+ player.health = 10
+ player.armour = 0
+ player.mana = 250
+
+ boss = main.Entity()
+ boss.health = 14
+ boss.damage = 8
+
+ result = main.solve_partn(1, player, boss)
+ self.assertEqual(result, 229 + 113 + 73 + 173 + 53)
+
+
+
+if __name__ == "__main__":
+ unittest.main()