Beispiel #1
0
        public void TestGetNCells()
        {
            var inky = new Inky(Directions.Right);

            Game.PacMansDirection = Directions.Right;

            var pacPos = new Point(23, 24);

            Assert.AreEqual(new Point(25, 24), inky.Get2CellsBeforePacman(pacPos));
            pacPos.X = 26;
            Assert.AreEqual(new Point(27, 24), inky.Get2CellsBeforePacman(pacPos));
            pacPos.X = 27;
            Assert.AreEqual(new Point(27, 24), inky.Get2CellsBeforePacman(pacPos));

            Game.PacMansDirection = Directions.Down;
            pacPos = new Point(27, 23);
            Assert.AreEqual(new Point(27, 25), inky.Get2CellsBeforePacman(pacPos));
            pacPos.Y = 26;
            Assert.AreEqual(new Point(27, 27), inky.Get2CellsBeforePacman(pacPos));
            pacPos.Y = 27;
            Assert.AreEqual(new Point(27, 27), inky.Get2CellsBeforePacman(pacPos));
        }