MbUnit has now the ability of re-executing the failed tests cases and ignoring the successful tests. A test case filter loads the previous XML result from a file and filters all the fixture that have not failed.
QuickStart example
This is the main function of MbUnit.Demo. We use the AutoRunner to make an assembly that is self-executable and we set the special filter (FailureRunPipeFilter). This filter will try to load the previous report. If it finds it, it will use the information to ignore successfull tests.
public static void Main(string[] args){ using (AutoRunner auto = new AutoRunner()) { // creating the report name string reportName = Path.GetFullPath(String.Format("{0}.xml", auto.GetReportName())); FailureRunPipeFilter filter = new FailureRunPipeFilter(reportName); auto.Domain.RunPipeFilter = filter; auto.Run(); auto.ReportToHtml(); auto.ReportToXml(false); }}
public static void Main(string[] args)
{
using (AutoRunner auto = new AutoRunner())
// creating the report name
string reportName = Path.GetFullPath(String.Format("{0}.xml", auto.GetReportName()));
auto.Domain.RunPipeFilter = filter;
auto.Run();
auto.ReportToHtml();
auto.ReportToXml(
}
Results:
I have executed twice MbUnit.Demo (don't be afraid about the number of failures, they are intentional, it's a demo!) The first report shows the first run result and second shows the second run report... Abracadadra, only failed tests remain
Page rendered at Thursday, December 04, 2008 6:00:15 AM UTC
Disclaimer The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.