Podczas używania xunit.runner.visualstudio
wersja 2.0.1 w Visual Studio 2015, nazwy testów są w pełni kwalifikowane. Czy istnieje sposób, aby testy pokazywały tylko nazwę metody?W jaki sposób skonfigurować XUnit tak, aby wyświetlał tylko nazwę metody w Eksploratorze testów programu Visual Studio 2015?
Rozważmy następujący test: -
namespace MySolution.Tests
{
public class MyTestClass
{
[Fact]
public void ClassUnderTest_WhenDefaultConstructorUsed_SomePropertyIsNotNull()
{
*... test code in here*
}
}
}
w Eksploratorze przetestować ten pokazuje, jak: -
MySolution.Tests.MyTestClass.ClassUnderTest_WhenDefaultConstructorUsed_SomePropertyIsNotNull
Używanie MSTest/VSTest ten pojawi się jako: -
ClassUnderTest_WhenDefaultConstructorUsed_SomePropertyIsNotNull
zobaczyć [niższą odpowiedź] (https://stackoverflow.com/a/41643793/1739931) dla __net-core__. – THBBFT