Skip to content

HTML Report

Greg Finzer edited this page Apr 11, 2019 · 1 revision

The HTML Report outputs the results to an HTML file. The launch application method will open the default browser.

[Test]publicvoidHtmlReportTest(){stringexpected=Path.Combine(AppDomain.CurrentDomain.BaseDirectory,"movie.html");if(File.Exists(expected))File.Delete(expected);Moviemovie1=newMovie();movie1.Name="Oblivion";movie1.PaymentForTomCruise=2000000M;Moviemovie2=newMovie();movie2.Name="Edge of Tomorrow";movie2.PaymentForTomCruise=3000000M;CompareLogiccompareLogic=newCompareLogic();compareLogic.Config.MaxDifferences=Int32.MaxValue;ComparisonResultresult=compareLogic.Compare(movie1,movie2);HtmlReporthtmlReport=newHtmlReport();// The config object is to overwrite the defaultshtmlReport.Config.GenerateFullHtml=true;// if false, it will only generate an html tablehtmlReport.Config.HtmlTitle="Comparison Report";htmlReport.Config.BreadCrumbColumName="Bread Crumb";htmlReport.Config.ExpectedColumnName="Expected";htmlReport.Config.ActualColumnName="Actual";//htmlReport.Config.IncludeCustomCSS(".diff-crumb {background: gray;}"); // add some custom csshtmlReport.OutputFile(result.Differences,expected);Assert.IsTrue(File.Exists(Path.Combine(AppDomain.CurrentDomain.BaseDirectory,expected)));htmlReport.LaunchApplication(expected);}

Clone this wiki locally