How to enable monospaced Test Explorer output?

52 views Asked by At

Is there a way to enable monospaced fonts like Consolas for output of Test Explorer in Visual Studio other than aligning entire UI through Environment setting?

Just want to print a fine looking table in output but always get aligned garbage. Setting Environment just make VS look too bulky.

Current workaround:

Tools -> Options -> Environment -> Fonts and Colors -> Show settings for: -> Environment

1

There are 1 answers

2
Drew Noakes On

What version of Visual Studio are you running? In VS2019 I see test output printed in a monospace font.

public class UnitTest1
{
    private readonly ITestOutputHelper _output;

    public UnitTest1(ITestOutputHelper output)
    {
        _output = output;
    }

    [Fact]
    public void Test1()
    {
        _output.WriteLine("A B C D E F G");
        _output.WriteLine("1 2 3 4 5 6 7");
    }
}

enter image description here