XUnit Tests Do Not Show Passing or Failing in Test Explorer with DisplayName Specified
See original GitHub issueAs the title says, tests with the DisplayName specified do not show up correctly in the test explorer; though the actual dotnet test command does appear to run the tests and the console output shows the correct pass/fail numbers.
This works:
[Fact]
public void TestMethod() { Assert.True(true); }
This does not (though dotnet test output shows tests pass)
[Fact(DisplayName="The Test Method")]
public void TestMethod() { Assert.True(true); }
Issue Analytics
- State:
- Created 5 years ago
- Comments:7
Top Results From Across the Web
Tests not running in Test Explorer - visual studio
Check what framework the tests are written against (e.g. nunit, xunit, VS test, etc.) and make sure you've got the correct test adapter/runner...
Read more >dotnet test command - .NET CLI | Microsoft Learn
The dotnet test command is used to execute unit tests in a given ... NUnit, or xUnit, and reports the success or failure...
Read more >Writing xUnit Tests in .NET Core - Visual Studio Magazine
In Test Explorer this test will appear under the heading Customer [Update] (each Name/Value combination appears as a separate heading in Test ...
Read more >Tips and Tricks | NUnit Docs
Certain NUnit Test Adapter settings are configurable using a .runsettings file. ... DefaultTestNamePattern, string, Pattern for display name, {m}{a}.
Read more >.NET Core Test Explorer - Visual Studio Marketplace
Extension for Visual Studio Code - Test Explorer for .NET Core (MSTest, xUnit, NUnit) ... Then, you will see all the tests in...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Might this be related to an issue I have?
When test discovery runs I see
CreateItem
in the list of tests. When I click the play icon next toCreateItem
, the test runs. Once the test passed or failed, I seen an additional test in the list:Item: Creation
with the correct status. The originalCreateItem
is still in the list and the icon indicates that it was not run. When I click the play icon next toItem: Creation
I get an error message saying that the test was not found.The display name makes xunit behave like nunit/mstest with regards to output from dotnet test -t. This will be fixed with #51.