diff --git a/test/testGhost.cpp b/test/testGhost.cpp index b841cd3..9837ae2 100644 --- a/test/testGhost.cpp +++ b/test/testGhost.cpp @@ -51,4 +51,27 @@ TEST(GhostTest, Frighten) { pacman::Pinky pinky; ghostFrightenHelper(pinky); -} \ No newline at end of file +} + +template +static void ghostDeadHelper(T & ghost) { + EXPECT_FALSE(ghost.isEyes()); + ghost.die(); + EXPECT_TRUE(ghost.isEyes()); + ghost.reset(); + EXPECT_FALSE(ghost.isEyes()); +} + +TEST(GhostTest, Dead) { + pacman::Blinky blinky; + ghostDeadHelper(blinky); + + pacman::Clyde clyde; + ghostDeadHelper(clyde); + + pacman::Inky inky; + ghostDeadHelper(inky); + + pacman::Pinky pinky; + ghostDeadHelper(pinky); +}