Beispiel #1
0
        static void Main( string[] args )
        {
            string testResultPath;
            string outputDirectory;

            try
            {
                if (args.Length < 1)
                {
                    Error("No arguments provided");
                    return;
                }

                if (args.Length > 2)
                {
                    Error("Too many arguments");
                    return;
                }

                if (args[0] == "?" || args[0] == "/?")
                {
                    Usage();
                    return;
                }

                testResultPath = args.Length > 0 ? args[0] : "TestResult.xml";
                outputDirectory = args.Length > 1 ? args[1] : "TestResults";

                TestResultReport report = new TestResultReport(testResultPath, outputDirectory);

                report.DoReport();
            }
            catch (FileNotFoundException exception)
            {
                Error(exception.Message);
            }
            catch (ApplicationException exception)
            {
                Error(exception.Message);
            }
            catch (Exception exception)
            {
                Error(exception.ToString());
            }
        }
        static void Main(string[] args)
        {
            string testResultPath;
            string outputDirectory;

            try
            {
                if (args.Length < 1)
                {
                    Error("No arguments provided");
                    return;
                }

                if (args.Length > 2)
                {
                    Error("Too many arguments");
                    return;
                }

                if (args[0] == "?" || args[0] == "/?")
                {
                    Usage();
                    return;
                }

                testResultPath  = args.Length > 0 ? args[0] : "TestResult.xml";
                outputDirectory = args.Length > 1 ? args[1] : "TestResults";

                TestResultReport report = new TestResultReport(testResultPath, outputDirectory);

                report.DoReport();
            }
            catch (FileNotFoundException exception)
            {
                Error(exception.Message);
            }
            catch (ApplicationException exception)
            {
                Error(exception.Message);
            }
            catch (Exception exception)
            {
                Error(exception.ToString());
            }
        }