Adding ghost dead test.

This commit is contained in:
Ólafur Waage 2021-09-07 15:30:48 +02:00
parent cbe5798590
commit ee4b216056
1 changed files with 24 additions and 1 deletions

View File

@ -51,4 +51,27 @@ TEST(GhostTest, Frighten) {
pacman::Pinky pinky;
ghostFrightenHelper(pinky);
}
}
template<typename T>
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);
}