Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            string path = @"..\..\folderstructure.xml";
            string target = @"..\..\__EntityEngine\";

            string xmlData = "";
            using (StreamReader sr = new StreamReader(path))
            {
                xmlData = sr.ReadToEnd();
            }

            Parser parser = new Parser();

            var folders = parser.ParseXmlDocumentS(xmlData);

            Generator.GenerateFolderStructure(target, folders);
        }
Ejemplo n.º 2
0
        public void NonMutableClassWitOnePorperty()
        {
            Parser parser = new Parser();
            string json = GetInputJson("NonMutableClassWithOnePorperty.json");
            string expectedOput = GetExpectedClass("NonMutableClassWithOnePorperty.cs")
                .Replace('\r'.ToString(), "")
                .Replace('\t'.ToString(), "")
                .Replace('\n'.ToString(), "");

            string output = parser.GenerateClass(json)
                .Replace('\r'.ToString(), "")
                .Replace('\t'.ToString(), "")
                .Replace('\n'.ToString(), "");

            Console.WriteLine("Input: \n{0}", json);

            Console.WriteLine("\n\nExpected: \n{0}", expectedOput);
            Console.WriteLine("\n\nOutput: \n{0}", output);

            Assert.AreEqual(expectedOput, output);
        }
Ejemplo n.º 3
0
 public void EmtyTest()
 {
     Parser parser = new Parser();
     Assert.AreEqual("Invalid input!", parser.GenerateClass(""));
 }