verify(mockResultsRepository).close();
}
@Test
public void writeSummary_WritesSummaryOfTestExecutions() throws Exception{
jf.testComplete(buildNestedTestPage(), new TestSummary(5,6,7,8));
WikiPageDummy root = new WikiPageDummy("root", null, null);
WikiPageDummy secondPage=new WikiPageDummy("SecondPage", null, root);
jf.testComplete(new WikiTestPage(secondPage, variableSource), new TestSummary(11,12,13,14));
jf.writeSummary("SummaryPageName");
String expectedOutput = new StringBuffer()
.append(JavaFormatter.TestResultsSummaryTable.SUMMARY_HEADER)
.append(new JavaFormatter.TestResultsSummaryTableRow(nestedPageName, new TestSummary(5,6,7,8)).toString())
.append(new JavaFormatter.TestResultsSummaryTableRow("SecondPage", new TestSummary(11,12,13,14)).toString())
.append(JavaFormatter.TestResultsSummaryTable.SUMMARY_FOOTER)
.toString();
verify(mockResultsRepository).open("SummaryPageName");
verify(mockResultsRepository, times(1)).write(expectedOutput);
}