예제 #1
0
        public void GhostGoDown_SavePreviousValue()
        {
            Field field = new Field();
            GHost ghost = new GHost(field);

            ghost.RealtimeCoordinate = new Coordinate(7, 1);
            ghost.previousValue      = " ";
            field.NewField[7, 1]     = "&";
            Assert.IsTrue(ghost.GoDown());
            Assert.AreEqual(" ", field.NewField[7, 1]);
        }
예제 #2
0
        public void GhostNotGoDown_NotSavePreviousValue()
        {
            Field field = new Field();
            GHost ghost = new GHost(field);

            ghost.RealtimeCoordinate = new Coordinate(1, 4);
            ghost.previousValue      = " ";
            field.NewField[1, 4]     = "&";
            Assert.IsFalse(ghost.GoDown());
            Assert.AreEqual("&", field.NewField[1, 4]);
        }
예제 #3
0
        public void GhostGoRightFromX23_SavePrevV()
        {
            Field field = new Field();
            GHost ghost = new GHost(field);

            ghost.RealtimeCoordinate = new Coordinate(7, 23);
            ghost.previousValue      = " ";
            field.NewField[7, 23]    = "&";
            Assert.IsTrue(ghost.GoRight());
            Assert.AreEqual(" ", field.NewField[7, 23]);
        }