private static void LoadObjectTreeFrom(string file) { log.Info("Attempting object tree load..."); DME dme = new DME(); dme.LoadFile(file); ObjectTree otr = new ObjectTree(); foreach (string filename in dme.Files) { if(filename.EndsWith(".dm")) otr.ProcessFile(filename); } log.Info("TREE LOAD COMPLETE"); Environment.Exit(0); }
//[DeploymentItem("TestFiles","TestFiles")] public void LoadFileTest() { //testContextInstance.WriteLine("CD: {0}", Environment.CurrentDirectory); DME target = new DME(); string filename = Path.Combine("TestFiles","Test.dme"); List<string> expected = new List<string>(); expected.Add(Path.GetFullPath(Path.Combine("TestFiles", "code", "global.dm"))); expected.Add(Path.GetFullPath(Path.Combine("TestFiles", "code", "world.dm"))); expected.Add(Path.GetFullPath(Path.Combine("TestFiles", "interface", "interface.dm"))); expected.Add(Path.GetFullPath(Path.Combine("TestFiles", "interface", "skin.dmf"))); expected.Add(Path.GetFullPath(Path.Combine("TestFiles", "maps", "tgstation.dmm"))); target.LoadFile(filename); Assert.AreEqual(target.Files.Count, 5, "Got incorrect # of files."); CollectionAssert.AllItemsAreInstancesOfType(target.Files, typeof(string), "Wrong types."); CollectionAssert.AreEqual(expected, target.Files, "Wrong entries"); }
//[DeploymentItem("TestFiles","TestFiles")] public void LoadFileTest() { //testContextInstance.WriteLine("CD: {0}", Environment.CurrentDirectory); DME target = new DME(); string filename = Path.Combine("TestFiles", "Test.dme"); List <string> expected = new List <string>(); expected.Add(Path.GetFullPath(Path.Combine("TestFiles", "code", "global.dm"))); expected.Add(Path.GetFullPath(Path.Combine("TestFiles", "code", "world.dm"))); expected.Add(Path.GetFullPath(Path.Combine("TestFiles", "interface", "interface.dm"))); expected.Add(Path.GetFullPath(Path.Combine("TestFiles", "interface", "skin.dmf"))); expected.Add(Path.GetFullPath(Path.Combine("TestFiles", "maps", "tgstation.dmm"))); target.LoadFile(filename); Assert.AreEqual(target.Files.Count, 5, "Got incorrect # of files."); CollectionAssert.AllItemsAreInstancesOfType(target.Files, typeof(string), "Wrong types."); CollectionAssert.AreEqual(expected, target.Files, "Wrong entries"); }
private static void LoadObjectTreeFrom(string file) { log.Info("Attempting object tree load..."); DME dme = new DME(); dme.LoadFile(file); ObjectTree otr = new ObjectTree(); foreach (string filename in dme.Files) { if (filename.EndsWith(".dm")) { otr.ProcessFile(filename); } } log.Info("TREE LOAD COMPLETE"); Environment.Exit(0); }