Exemplo n.º 1
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");
            }
        }
Exemplo 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");
            }
        }
Exemplo n.º 3
0
        static void Main(string[] args)
        {
            Console.WriteLine("trx2html.exe \n  Create HTML reports of VSTS TestRuns. (c)rido'08");
            Console.WriteLine("version:" + Assembly.GetExecutingAssembly().GetName().Version.ToString() + "\n");
            if (args.Length != 1)
            {
                Console.WriteLine("Usage: trx2html <TestResult>.trx");
                return;
            }

            string           fileName = args[0];
            VersionFinder    v        = new VersionFinder();
            SupportedFormats f        = v.GetFileVersion(fileName);

            if (f == SupportedFormats.unknown)
            {
                Console.WriteLine("File {0} is not a recognized trx", fileName);
            }
            {
                Console.WriteLine("Processing {0} trx file", f.ToString());
                Transform(fileName, PrepareXsl(f.ToString()));
                Console.WriteLine("Tranformation Succeed. OutputFile: " + fileName + ".htm\n");
            }
        }