static void Main(string[] args)
        {
            Console.Write("\n  Testing TestRequest");
            Console.Write("\n =====================");

            string savePath = "../../test/";
            string fileName = "TestRequest1.xml";

            if (!System.IO.Directory.Exists(savePath))
                System.IO.Directory.CreateDirectory(savePath);
            string fileSpec = System.IO.Path.Combine(savePath, fileName);
            fileSpec = System.IO.Path.GetFullPath(fileSpec);

            BuildRequest tr = new BuildRequest();
            tr.author = "Jim Fawcett";
            tr.testDriver = "td1.cs";
            tr.testedFiles.Add("tf1.cs");
            tr.testedFiles.Add("tf2.cs");
            tr.testedFiles.Add("tf3.cs");
            tr.makeRequest();
            Console.Write("\n{0}", tr.doc.ToString());

            Console.Write("\n  saving to \"{0}\"", fileSpec);
            tr.saveXml(fileSpec);

            Console.Write("\n  reading from \"{0}\"", fileSpec);

            BuildRequest tr2 = new BuildRequest();
            tr2.loadXml(fileSpec);
            Console.Write("\n{0}", tr2.doc.ToString());
            Console.Write("\n");

            tr2.parse("author");
            Console.Write("\n  author is \"{0}\"", tr2.author);

            tr2.parse("dateTime");
            Console.Write("\n  dateTime is \"{0}\"", tr2.dateTime);

            tr2.parse("testDriver");
            Console.Write("\n  testDriver is \"{0}\"", tr2.testDriver);

            tr2.parseList("tested");
            Console.Write("\n  testedFiles are:");
            foreach (string file in tr2.testedFiles)
            {
                Console.Write("\n    \"{0}\"", file);
            }
            Console.Write("\n\n");
        }
Exemple #2
0
        // Gets the list of the code files from the XML file in the XML storage path
        private List <string> getArguments(string xmlFile)
        {
            BuildRequest.BuildRequest br        = new BuildRequest.BuildRequest();
            List <string>             codeFiles = new List <string>();
            string fileSpec = System.IO.Path.Combine("../../RepoFileStorage/XML", xmlFile);

            fileSpec = System.IO.Path.GetFullPath(fileSpec);
            br.loadXml(fileSpec);
            br.parse("testDriver");
            codeFiles.Add(br.testDriver);
            br.parseList("tested");
            foreach (string file in br.testedFiles)
            {
                codeFiles.Add(file);
            }

            return(codeFiles);
        }