/*--------< Serializes any objects to XML that represents test requests >--------------*/ public void objSerialization() { TestRequest tr = new TestRequest(); getFiles("*.dll"); List <TestRequest> testRequestLists = new List <TestRequest>(); List <string> tl = new List <string>(); foreach (string file in _files) { Console.WriteLine("Adding a file :" + Path.GetFileName(file) + "to TestRequest.xml file"); tl.Add(Path.GetFileName(file)); tr.TestLibraries = tl; testRequestLists.Add(tr); } ToAndFromXml xSerialization = new ToAndFromXml(); string testRequest = "TestRequest"; _testRequestFilename = xSerialization.ToXml(testRequestLists, _childStoragePath, testRequest); // Serialization }
/*--------< Serializes any objects to XML that represents build requests >--------------*/ public string ObjSerialization(List <Test> tests) { BuildRequest br = new BuildRequest(); List <BuildRequest> buildRequestLists = new List <BuildRequest>(); br.Tests = tests; buildRequestLists.Add(br); ToAndFromXml xSerialization = new ToAndFromXml(); string buildRequest = "BuildRequest"; _brqXMLFileName = xSerialization.ToXml(buildRequestLists, defaultPath, buildRequest); Console.BackgroundColor = ConsoleColor.Black; Console.ForegroundColor = ConsoleColor.Magenta; Console.WriteLine("Generating " + _brqXMLFileName + "\n"); Console.WriteLine("\n====================================================\n\n\n"); Console.ResetColor(); Console.BackgroundColor = ConsoleColor.Black; Console.ForegroundColor = ConsoleColor.Yellow; Console.WriteLine(readXML((_brqXMLFileName))); Console.ResetColor(); return(_brqXMLFileName); }