Skip to content

Instantly share code, notes, and snippets.

@peteraritchie
Created September 30, 2025 20:21
Show Gist options
  • Select an option

  • Save peteraritchie/fbaf7bce44a3da8d5ec5fe3c276b053f to your computer and use it in GitHub Desktop.

Select an option

Save peteraritchie/fbaf7bce44a3da8d5ec5fe3c276b053f to your computer and use it in GitHub Desktop.
// a class to wrapp xunits ITestOutputHelper as a TextWriter
public class TestOutputHelperWriter(ITestOutputHelper helper) : TextWriter
{
public override Encoding Encoding { get; } = Encoding.Unicode;
public override void WriteLine(string? value)
{
helper.WriteLine(value);
}
public override void WriteLine([StringSyntax("CompositeFormat")] string format, params object?[] args)
{
helper.WriteLine(format, args);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment