Adding ghost dead test.
This commit is contained in:
parent
cbe5798590
commit
ee4b216056
1 changed files with 24 additions and 1 deletions
|
@ -52,3 +52,26 @@ 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);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue