add tests
test revive for level 9 and 10
@@ -15,6 +15,38 @@ fn test_reviving_dead_player() {
assert_eq!(revived_player.level, dead_player.level);
}
+#[test]
+#[ignore]
+fn test_reviving_dead_level9_player() {
+ let dead_player = Player {
+ health: 0,
+ mana: Some(0),
+ level: 9,
+ };
+ let revived_player = dead_player
+ .revive()
+ .expect("reviving a dead player must return Some(player)");
+ assert_eq!(revived_player.health, 100);
+ assert_eq!(revived_player.mana, None);
+ assert_eq!(revived_player.level, dead_player.level);
+}
+
+#[test]
+#[ignore]
+fn test_reviving_dead_level10_player() {
+ let dead_player = Player {
+ health: 0,
+ mana: Some(0),
+ level: 10,
+ };
+ let revived_player = dead_player
+ .revive()
+ .expect("reviving a dead player must return Some(player)");
+ assert_eq!(revived_player.health, 100);
+ assert_eq!(revived_player.mana, Some(100));
+ assert_eq!(revived_player.level, dead_player.level);
+}
+
#[test]
#[ignore]
fn test_reviving_alive_player() {
