Home

Xunit test result output file

How do I get the xunit test results captured in a output file?

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:

    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.

  • edited November 2

    Thanks alot Joe! It worked and this helps me customise my xunit methods.

Sign In or Register to comment.