Ejemplo n.º 1
0
 public void CreateHtmlFile()
 {
     TrxParser parser = new TrxParser();
     var result = parser.Parse("VS2010.trx.xml");
     HtmlConverter html = new HtmlConverter(result);
     string fileName = Path.Combine(System.Environment.CurrentDirectory, @"newTrx2Html.html");
     using (TextWriter file = File.CreateText(fileName))
     {
         file.Write(html.GetHtml());
     }
     Process.Start("IExplore.exe", fileName);
 }
Ejemplo n.º 2
0
        internal static void GenerateReport(string fileName)
        {
            VersionFinder v = new VersionFinder();
            SupportedFormats f = v.GetFileVersion(fileName);
            if (f != SupportedFormats.vs2010)
            {
                Console.WriteLine("File {0} is not a recognized as a valid trx. Only VS2010 are supported", fileName);
            }
            else
            {
                Console.WriteLine("Processing {0} trx file", f.ToString());

                TrxParser parser = new TrxParser();
                TestRunResult r = parser.Parse(fileName);
                string html = new HtmlConverter(r).GetHtml();

                using (TextWriter file = File.CreateText(fileName + ".htm"))
                {
                    file.Write(html);
                }

                Console.WriteLine("Tranformation Succeed. OutputFile: " + fileName + ".htm\n");
            }
        }