Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
public class LoadTestReportGenerator
{
public void GenerateReport(LoadTestRunResults loadTestRunResults, string reportPath)
{
string htmlReportContent = GenerateHtml(loadTestRunResults);
File.WriteAllText(reportPath, htmlReportContent);
}
private string GenerateHtml(LoadTestRunResults loadTestRunResults)
{
var testScenarioHtmlReportGenerator = new TestScenarioHtmlReportGenerator();
var testScenarioJavaScriptReportGenerator = new TestScenarioJavaScriptReportGenerator();
string htmlTemplate = File.ReadAllText("reportTemplate.html");
string htmlPart = testScenarioHtmlReportGenerator.GenerateHtml(loadTestRunResults);
string jsPart = testScenarioJavaScriptReportGenerator.GenerateJavaScript(loadTestRunResults);
htmlTemplate = htmlTemplate.Replace("#htmlPlaceHolder#", htmlPart);
htmlTemplate = htmlTemplate.Replace("#javaScriptPlaceHolder#", jsPart);
return htmlTemplate;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.