Home
Options

Xunit test result output file

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

Comments

  • Options

    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.

  • Options
    edited November 2022

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

Sign In or Register to comment.