/// <summary>
        /// Perform top-level analysis and produce standard reports
        /// </summary>
        public void DoReport()
        {
            if (!Directory.Exists(outputDirectory))
            {
                Directory.CreateDirectory(outputDirectory);
            }

            string title = string.Format("{0} Test Results", Path.GetFileNameWithoutExtension(testResultPath));

            indexPage = new HtmlPage(Path.Combine(outputDirectory, "index.html"));
            indexPage.Begin(title);

            try
            {
                resultLoader.Load(testResultPath);
            }
            catch (ApplicationException ex)
            {
                indexPage.WriteLine(ex.Message);
                throw;
            }
            catch (Exception ex)
            {
                indexPage.WriteLine(ex.ToString());
                throw;
            }

            InitializeProjectIndex();

            testCount    = 0;
            notRunCount  = 0;
            failureCount = 0;


            foreach (TestResult suiteResult in resultLoader.ProjectResults)
            {
                string projectName = Path.GetFileNameWithoutExtension(suiteResult.Name);
                Console.WriteLine("Analyzing {0}", projectName);

                TestResultAnalyzer analyzer = new TestResultAnalyzer(projectName);
                analyzer.FindFixtures(suiteResult);
                analyzer.Analyze();

                testCount    += analyzer.TestCount;
                notRunCount  += analyzer.NotRunCount;
                failureCount += analyzer.FailureCount;

                WriteIndexEntry(analyzer);
                WriteDetailPage(analyzer);
            }

            TerminateProjectIndex();

            indexPage.End();

            Console.WriteLine("Analysis Complete");
            Console.WriteLine("Report created in directory {0}", Path.GetFullPath(outputDirectory));
        }
        private void WriteDetailPage(TestResultAnalyzer analyzer)
        {
            HtmlPage page = new HtmlPage(Path.Combine(outputDirectory, analyzer.Name + ".html"));

            WriteDetailTable(page, analyzer);

            if (analyzer.FailureCount > 0)
            {
                WriteFailureTable(page, analyzer);
            }

            if (analyzer.NotRunCount > 0)
            {
                WriteNotRunTable(page, analyzer);
            }

            page.End();
        }
        /// <summary>
        /// Perform top-level analysis and produce standard reports
        /// </summary>
        public void DoReport()
        {
            if( !Directory.Exists( outputDirectory ) )
                Directory.CreateDirectory( outputDirectory );

            string title = string.Format( "{0} Test Results", Path.GetFileNameWithoutExtension( testResultPath ) );
            indexPage = new HtmlPage( Path.Combine( outputDirectory, "index.html" ) );
            indexPage.Begin( title );

            try
            {
                resultLoader.Load( testResultPath );
            }
            catch ( ApplicationException ex )
            {
                indexPage.WriteLine( ex.Message );
                throw;
            }
            catch ( Exception ex )
            {
                indexPage.WriteLine( ex.ToString() );
                throw;
            }

            InitializeProjectIndex();

            testCount = 0;
            notRunCount = 0;
            failureCount = 0;

            foreach( TestResult suiteResult in resultLoader.ProjectResults )
            {
                string projectName = Path.GetFileNameWithoutExtension( suiteResult.Name );
                Console.WriteLine( "Analyzing {0}", projectName );

                TestResultAnalyzer analyzer = new TestResultAnalyzer( projectName );
                analyzer.FindFixtures( suiteResult );
                analyzer.Analyze();

                testCount += analyzer.TestCount;
                notRunCount += analyzer.NotRunCount;
                failureCount += analyzer.FailureCount;

                WriteIndexEntry( analyzer );
                WriteDetailPage( analyzer );
            }

            TerminateProjectIndex();

            indexPage.End();

            Console.WriteLine( "Analysis Complete" );
            Console.WriteLine( "Report created in directory {0}", Path.GetFullPath( outputDirectory ) );
        }
        private void WriteDetailPage( TestResultAnalyzer analyzer )
        {
            HtmlPage page = new HtmlPage( Path.Combine( outputDirectory, analyzer.Name + ".html" ) );

            WriteDetailTable( page, analyzer );

            if ( analyzer.FailureCount > 0 )
                WriteFailureTable( page, analyzer );

            if ( analyzer.NotRunCount > 0 )
                WriteNotRunTable( page, analyzer );

            page.End();
        }