Example #1
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");
        }