예제 #1
0
        public void m_MapTest_Corners_AllMaps()
        {
            Game aGame = new Game();
            aGame.SetMap(1);
            Tile[,] theMap;
            Tile[][,] allTheMaps = aGame.GetFiler().GetAllMyMaps();
            bool expected, actual;
            expected = false;
            actual = false;

            // return true if one corner is broken in one of the maps

            for (int i = 0; i < allTheMaps.Length; i++)
            {
                if (allTheMaps[i] != null)
                {
                    theMap = allTheMaps[i];
                    if (aGame.AreCornersBroken(theMap) == true)
                    {
                        actual = true;
                    }
                }
            }

            Assert.AreEqual(expected, actual, "One of the corners is broken in the Map library");
        }
예제 #2
0
        public void m_MapTest_EastWallBroken_AllMaps()
        {
            Game aGame = new Game();
            aGame.SetMap(1);
            Tile[,] theMap;
            Tile[][,] allTheMaps = aGame.GetFiler().GetAllMyMaps();
            bool expected, actual;
            expected = false;
            actual = false;

            // return true if one East wall is broken

            for (int i = 0; i < allTheMaps.Length; i++)
            {
                if (allTheMaps[i] != null)
                {
                    theMap = allTheMaps[i];
                    if (aGame.EastWallBroken(theMap) == true)
                    {
                        actual = true;
                    }
                }
            }

            Assert.AreEqual(expected, actual, "One of the East walls is broken");
        }
예제 #3
0
        public void m_MapTest_HasExitTile_allMaps()
        {
            Game aGame = new Game();
            aGame.SetMap(1);
            Tile[,] theMap;
            Tile [][,] allTheMaps = aGame.GetFiler().GetAllMyMaps();
            bool expected, actual;
            expected = true;
            actual = true;

            // return true if one tile is the exit, else return false

            for (int i = 0;  i < allTheMaps.Length; i++)
            {
                if (allTheMaps[i] != null)
                {
                    theMap = allTheMaps[i];
                    if (aGame.HasExitTile(theMap) == false)
                    {
                        actual = false;
                    }
                }
            }
            Assert.AreEqual(expected, actual, "One of the maps does not have an exit tile");
        }