コード例 #1
0
        public void TestIsVictory_NorthEastCornerExit()
        {
            int[,] labyrinthGrid = new int[7, 7]
                        {
                            {0, 0, 1, 1, 1, 1, 0},
                            {1, 1, 1, 1, 0, 0, 1},
                            {0, 0, 0, 1, 0, 1, 0},
                            {1, 0, 1, 0, 0, 1, 1},
                            {0, 1, 0, 1, 1, 0, 0},
                            {0, 0, 1, 0, 0, 0, 0},
                            {0, 0, 1, 0, 1, 0, 0}
                        };
            Position customPosition = new Position(0, 6);
            Playfield playfield = new Playfield(labyrinthGrid, customPosition);

            bool expected = true;
            bool actual = playfield.IsVictory();
            Assert.AreEqual(expected, actual);
        }
コード例 #2
0
        public void TestIsVictory_NotAVictory()
        {
            int[,] labyrinthGrid = new int[7, 7]
                        {
                            {0, 0, 1, 1, 1, 1, 0},
                            {1, 1, 1, 1, 0, 0, 1},
                            {0, 0, 0, 1, 0, 1, 0},
                            {1, 0, 1, 0, 0, 1, 1},
                            {0, 1, 0, 1, 1, 0, 0},
                            {0, 0, 1, 0, 0, 0, 0},
                            {0, 0, 1, 0, 1, 0, 0}
                        };
            Position customPosition = new Position(4, 2);
            Playfield playfield = new Playfield(labyrinthGrid, customPosition);

            bool expected = false;
            bool actual = playfield.IsVictory();
            Assert.AreEqual(expected, actual);
        }