コード例 #1
0
        public void RunFinished(ITestResultAdaptor results)
        {
            if (silent && results.FailCount == 0)
            {
                return;
            }

            if (verbose || results.FailCount > 0)
            {
                CLITools.PrintBanner("Tests");
                PrintTest(results, 0);
            }

            Console.WriteLine();
            CLITools.PrintInlineBanner("Test Summary");
            Console.WriteLine(" Passed: " + results.PassCount);
            Console.WriteLine(" Failed: " + results.FailCount);
            Console.WriteLine(" Skipped/Inconclusive: " + (results.SkipCount + results.InconclusiveCount));
            CLITools.PrintBannerBar();
            Console.WriteLine();

            if (results.FailCount > 0)
            {
                throw new Exception("Fix your tests, dag nabbit!");
            }
        }
コード例 #2
0
        //-------------------------------------------------------------------------
        // Helper Methods
        //-------------------------------------------------------------------------
        private void PrintReport(BuildReport report)
        {
            CLITools.PrintInlineBanner("Steps");

            foreach (BuildStep step in report.steps)
            {
                int    depth   = step.depth;
                string message = "";
                if (depth == 0)
                {
                    message += "Step: ";
                }
                else
                {
                    message += new String(' ', (depth - 1) * 3);
                    message += " - ";
                }
                message += step.name + " - " + step.duration.TotalMilliseconds + "ms";
                Console.WriteLine(message);
            }

            CLITools.PrintInlineBanner("Build Complete");
        }