Exemplo n.º 1
0
        private static void ProcessSingleTrxFile(string trxFileName, string label, AnalysisMode mode)
        {
            var oldColor = Console.ForegroundColor;

            try
            {
                if (!File.Exists(trxFileName))
                {
                    Console.Write(label.PadRight(35));
                    Console.ForegroundColor = ConsoleColor.Red;
                    Console.WriteLine("TRX file not found!");
                }
                else
                {
                    XElement element  = XElement.Load(trxFileName);
                    var      analyzer = new MSTestResultsFileAnalyzer(element.Name.Namespace);
                    analyzer.Label = label;
                    analyzer.Mode  = mode;
                    analyzer.DumpSummary(element);
                }
            }
            finally
            {
                Console.ForegroundColor = oldColor;
            }
        }
Exemplo n.º 2
0
        static int Main(string[] args)
        {
            var oldColor = Console.ForegroundColor;

            try
            {
                if (args.Length < 2)
                {
                    Usage();
                    return(1);
                }

                string trxFileName = args[1];
                if (!File.Exists(trxFileName))
                {
                    Console.Write(args[0].PadRight(35));
                    Console.ForegroundColor = ConsoleColor.Red;
                    Console.WriteLine("TRX file not found!");
                    return(0);
                }

                XElement element  = XElement.Load(trxFileName);
                var      analyzer = new MSTestResultsFileAnalyzer(element.Name.Namespace);
                analyzer.Label = args[0];
                analyzer.DumpSummary(element);

                return(0);
            }
            catch (Exception ex)
            {
                Console.ForegroundColor = ConsoleColor.Red;
                Console.WriteLine("ERROR: {0}", ex);
                return(1);
            }
            finally
            {
                Console.ForegroundColor = oldColor;
            }
        }
Exemplo n.º 3
0
        static int Main(string[] args)
        {
            var oldColor = Console.ForegroundColor;

            try
            {
                if (args.Length < 2)
                {
                    Usage();
                    return 1;
                }

                string trxFileName = args[1];
                if (!File.Exists(trxFileName))
                {
                    Console.Write(args[0].PadRight(35));
                    Console.ForegroundColor = ConsoleColor.Red;
                    Console.WriteLine("TRX file not found!");
                    return 0;
                }

                XElement element = XElement.Load(trxFileName);
                var analyzer = new MSTestResultsFileAnalyzer(element.Name.Namespace);
                analyzer.Label = args[0];
                analyzer.DumpSummary(element);

                return 0;
            }
            catch (Exception ex)
            {
                Console.ForegroundColor = ConsoleColor.Red;
                Console.WriteLine("ERROR: {0}", ex);
                return 1;
            }
            finally
            {
                Console.ForegroundColor = oldColor;
            }
        }
Exemplo n.º 4
0
 private static void ProcessSingleTrxFile(string trxFileName, string label, AnalysisMode mode)
 {
     var oldColor = Console.ForegroundColor;
     try
     {
         if (!File.Exists(trxFileName))
         {
             Console.Write(label.PadRight(35));
             Console.ForegroundColor = ConsoleColor.Red;
             Console.WriteLine("TRX file not found!");
         }
         else
         {
             XElement element = XElement.Load(trxFileName);
             var analyzer = new MSTestResultsFileAnalyzer(element.Name.Namespace);
             analyzer.Label = label;
             analyzer.Mode = mode;
             analyzer.DumpSummary(element);
         }
     }
     finally
     {
         Console.ForegroundColor = oldColor;
     }
 }