Return the string representation of the test
XUnitTestXml should transform a success test
auto epoch = SysTime.fromUnixTime(0); TestResult result = new TestResult("Test"); result.begin = Clock.currTime; result.end = Clock.currTime; result.status = TestResult.Status.success; auto allure = XUnitTestXml(result); allure.toString.strip.should.equal(`<testcase name="Test">` ~ "\n </testcase>");
XUnitTestXml should transform a failing test
auto epoch = SysTime.fromUnixTime(0); TestResult result = new TestResult("Test"); result.begin = Clock.currTime; result.end = Clock.currTime; result.status = TestResult.Status.failure; result.throwable = new Exception("message"); auto xunit = XUnitTestXml(result); xunit.toString.strip.should.equal(`<testcase name="Test">` ~ "\n" ~ ` <failure message="message">` ~ result.throwable.to!string ~ `</failure>` ~ "\n" ~ ` </testcase>`);