How do I get the xunit test results captured in a output file?
You have almost complete control over how xunit is called, by editing the xunit.linq script.
For instance, try adding the following code to the OnExecutionComplete event handler in the RunTests method:
File.WriteAllText (@"testresults.html", Util.ToHtmlString (dc.Content)); Util.Cmd (@"explorer .");
or:
new LINQPad.Controls.Button ("Export", _ => { File.WriteAllText (@"testresults.html", Util.ToHtmlString (dc.Content)); Util.Cmd (@"explorer ."); }).Dump();
You can add additional optional parameters to the RunTests method to make this behavior optional.
Thanks alot Joe! It worked and this helps me customise my xunit methods.
Comments
You have almost complete control over how xunit is called, by editing the xunit.linq script.
For instance, try adding the following code to the OnExecutionComplete event handler in the RunTests method:
or:
You can add additional optional parameters to the RunTests method to make this behavior optional.
Thanks alot Joe! It worked and this helps me customise my xunit methods.