Пример #1
0
        public void CheckStructureTest()
        {
            string mapLocation = Application.dataPath + "/maps/testmaps/test1.structure";

            Color?[][][] expectedResult = new Color?[2][][] {
                new Color?[2][] { new Color?[2] {
                                      ColorModel.RED, null
                                  }
                                  , new Color?[2] {
                                      null, ColorModel.PURPLE
                                  } }
                , new Color?[2][] { new Color?[2] {
                                        ColorModel.BLUE, null
                                    }
                                    , new Color?[2] {
                                        null, ColorModel.GREEN
                                    } }
            };

            Color?[, ,] parsedResult = StructureReader.loadLevel(mapLocation);


            //Assert.Fail ("not implemented");
            int size = expectedResult.Length;

            for (int x = 0; x < size; x++)
            {
                for (int y = 0; y < size; y++)
                {
                    for (int z = 0; z < size; z++)
                    {
                        string errorMessage = "at " + x + " " + y + " " + z;
                        Assert.AreEqual(parsedResult[x, y, z], expectedResult[y][x][z], errorMessage);
                    }
                }
            }
        }
Пример #2
0
 public static void Awake()
 {
     Structure = new Structure <Color?>(StructureReader.loadRandomLevelFromMaps());
 }