Esempio n. 1
0
        public void TestSaveSimulation()
        {
            string        path  = @".\Data\Simulation_Results.txt";
            List <string> lines = new List <string> {
                "C - 3 - 4", "M - 1 - 0", "M - 2 - 1", "T - 0 - 3 - 2", "T - 1 - 3 - 3",
                "A - Lara - 1 - 1 - S - AADADAGGA"
            };
            Map map = MapManagement.CreateMapWithInitialData(lines);

            MapManagement.SimulateTreasureSearch(map);
            Assert.AreEqual(Messages.FileSavedOK + path, FileManagement.SaveSimulation(map, path));
        }
Esempio n. 2
0
        public void TestSimulateTreasureSearch()
        {
            List <string> lines = new List <string> {
                "C - 3 - 4", "M - 1 - 0", "M - 2 - 1", "T - 0 - 3 - 2", "T - 1 - 3 - 3",
                "A - Lara - 1 - 1 - S - AADADAGGA"
            };
            Map map = MapManagement.CreateMapWithInitialData(lines);

            MapManagement.SimulateTreasureSearch(map);
            Assert.AreEqual(0, map?.Adventurers[0].X);
            Assert.AreEqual(3, map?.Adventurers[0].Y);
            Assert.AreEqual(Orientation.S, map?.Adventurers[0].Orientation);
            Assert.AreEqual(3, map?.Adventurers[0].CollectedTreasure);
        }