Example #1
0
        public void TextToXmlAndBack()
        {
            DirectoryInfo di = new DirectoryInfo(@"C:\Users\Lachlan\Documents\Visual Studio Projects\Phpbb.ModTeam.Tools\bin\Debug\xmlandback");

            FileInfo[] modFiles = di.GetFiles();
            foreach (FileInfo modFile in modFiles)
            {
                string input = OpenTextFile(modFile.FullName);
                Console.WriteLine(modFile.FullName);
                TextMod newMod = new TextMod(@"C:\Users\Lachlan\Documents\Visual Studio Projects\Phpbb.ModTeam.Tools\bin\Debug");
                newMod.ReadString(input);
                string xmlFileName = Path.Combine(Path.Combine(modFile.DirectoryName, "xml"), modFile.Name + ".xml");
                ((ModxMod)newMod).Write(xmlFileName);
                TextMod ultraMod = new TextMod(@"C:\Users\Lachlan\Documents\Visual Studio Projects\Phpbb.ModTeam.Tools\bin\Debug");
                ((ModxMod)ultraMod).Read(xmlFileName);
                ultraMod.AuthorNotesIndent      = newMod.AuthorNotesIndent;
                ultraMod.AuthorNotesStartLine   = newMod.AuthorNotesStartLine;
                ultraMod.DescriptionIndent      = newMod.DescriptionIndent;
                ultraMod.ModFilesToEditIndent   = newMod.ModFilesToEditIndent;
                ultraMod.ModIncludedFilesIndent = newMod.ModIncludedFilesIndent;
                string temp = ultraMod.ToString();

                /*Console.Error.WriteLine("Actions");
                 * Assert.AreEqual(true, newMod.Actions.Equals(ultraMod.Actions));
                 * Console.Error.WriteLine("Header");
                 * Assert.AreEqual(true, newMod.Header.Equals(ultraMod.Header));*/
                Assert.AreEqual(newMod.ToString(), temp);
            }
        }
Example #2
0
        public void SimpleTest()
        {
            DirectoryInfo di = new DirectoryInfo(@"C:\Users\Lachlan\Documents\Visual Studio Projects\Phpbb.ModTeam.Tools\bin\Debug\simpletest");

            FileInfo[] modFiles = di.GetFiles();
            foreach (FileInfo modFile in modFiles)
            {
                string  input  = OpenTextFile(modFile.FullName);
                TextMod newMod = new TextMod(@"C:\Users\Lachlan\Documents\Visual Studio Projects\Phpbb.ModTeam.Tools\bin\Debug");
                newMod.ReadString(input);
                input = input.Replace("\r\n", "\n");
                input = input.Replace("\r", "\n");
                Console.Out.WriteLine(modFile.FullName);
                Assert.AreEqual(input, newMod.ToString());
            }
        }
Example #3
0
        public void AdvancedTest_DeepCompare()
        {
            DirectoryInfo di = new DirectoryInfo(@"C:\Users\Lachlan\Documents\Visual Studio Projects\Phpbb.ModTeam.Tools\bin\Debug\advancedtest");

            FileInfo[] modFiles = di.GetFiles();
            foreach (FileInfo modFile in modFiles)
            {
                string input = OpenTextFile(modFile.FullName);
                Console.WriteLine(modFile.FullName);
                TextMod newMod = new TextMod(@"C:\Users\Lachlan\Documents\Visual Studio Projects\Phpbb.ModTeam.Tools\bin\Debug");
                newMod.ReadString(input);
                TextMod ultraMod = new TextMod(@"C:\Users\Lachlan\Documents\Visual Studio Projects\Phpbb.ModTeam.Tools\bin\Debug");
                ultraMod.ReadString(newMod.ToString());
                string temp = ultraMod.ToString();
                Console.Error.WriteLine("Actions");
                Assert.AreEqual(true, newMod.Actions.Equals(ultraMod.Actions));
                Console.Error.WriteLine("Header");
                Assert.AreEqual(true, newMod.Header.Equals(ultraMod.Header));
            }
        }