Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get VS Test Explorer to show only test name not full type name

My VS test explorer shows tests including the full type name, like so:

CompanyName.ProjectName.Web.Tests.SutDoesWhatItShould

Instead of just:

SutDoesWhatItShould

This is highly unreadable/annoying. How do I fix this?

I'm using the xunit runner for visual studio (prerelease) and xunit.net.

like image 292
Aage Avatar asked Feb 18 '15 08:02

Aage


People also ask

How do I run Mstest in Visual Studio?

Run tests in Test Explorer If Test Explorer is not visible, choose Test on the Visual Studio menu, choose Windows, and then choose Test Explorer (or press Ctrl + E, T). As you run, write, and rerun your tests, the Test Explorer displays the results in a default grouping of Project, Namespace, and Class.

How do I stop a test case from running in Visual Studio?

You need to close the Test Explorer Window to prevent automatic running.


1 Answers

In v2 this is now configurable, see http://xunit.github.io/docs/configuration-files.html

So you need to add to app.config:

<appSettings>
    <add key="xunit.methodDisplay" value="method"/>
</appSettings>

and as noted in the comments, you might need to restart Visual Studio.

like image 163
robi-y Avatar answered Oct 17 '22 12:10

robi-y