public void CheckCollisionsMethodTest_ValidInput() { Ghost ghost = getGhost(); Vector2 pacmanPos = new Vector2(2, 2); ghost.Position = pacmanPos; bool expected = true; bool actual = false; ghost.PacmanDiedEvent += () => { actual = true; }; ghost.CheckCollisions(pacmanPos); Assert.AreEqual(expected, actual); }
public void CollisionMethodTest_Valid() { Ghost ghost = null; gs.Pacman.Position = new Vector2(3, 1); bool expected = true; bool actual = false; foreach (Ghost g in gs.GhostPack) { ghost = g; } ghost.PacmanDiedEvent += () => { actual = true; }; ghost.CheckCollisions(gs.Pacman.Position); //ghost.CheckCollisions(gs.Pacman.Position); Assert.AreEqual(expected, actual); }
public void CheckCollisionsMethodTest_InvalidInput() { Ghost ghost = getGhost(); ghost.CheckCollisions(new Vector2(-1, 1)); }