Write to Test Detail Summary

Using xunit use the ITestOutputHelper interface to write to the Test Detail Summary pane of the Test Explorer.

You will need the xunit.runner.visualstudio package installed.

using Xunit; using Xunit.Abstractions; public class MyTestClass { private readonly ITestOutputHelper output; public MyTestClass(ITestOutputHelper output) { this.output = output; } [Fact] public void MyTest() { var temp = “my class!”; output.WriteLine(“This is output from {0}”, temp); } }