1

I'm making a custom HTML Helper inside a .NET Core 2.0 project, also there's a XUnit Test Project who belongs to the same solution, I have managed to test in console and everything runs fine, but I have to navigate on folders by console going in and out of my test folder when I want to use git add . and then comming back to test, that's why I think a UI for testing will be useful, but it doesn't recognizes my tests.

The folder structure is like this:

Solution folder
   --->.git
   --->CustomTableMVCProject
   --->TestsProject

The folder that I've opened in VS Code is the Solution Folder, so I can access to everything I need.

How can I configure this to work as it should be? I have Xunit.runner.visualstudio and Xunit.runner.console installed as nuget packages, and I'm using VS Code on Windows.

Gama11
  • 31,714
  • 9
  • 78
  • 100
elG
  • 539
  • 1
  • 6
  • 20

2 Answers2

1

Install .NET Core Test Explorer extension Set dotnet-test-explorer.testProjectPath to the folder path of your test project in settings.json In .NET Test Explorer of Explorer view, all the tests should be detected and you should be able to run tests via VSCode.

cengiz sevimli
  • 1,461
  • 8
  • 19
  • 1
    Thank you, that solved my problem, it was just the wrong extension. By the way I didn't need to set the folder path, my tests were automatically recognized. Just a little observation, the link you posted redirects to NXUnit Text Explorer published by wghats, and the .NET Core Test Explorer, the one that worked for me, is published by Jun Han. – elG Dec 13 '19 at 06:47
  • If you are on WSL, it does not work first time. https://github.com/formulahendry/vscode-dotnet-test-explorer/issues/179 Run one test manually and then it starts working. Also make sure you have the right framework SDK installed. – Marius Jun 29 '21 at 09:25
0

I got the same issue with Test Explorer UI.
PHPUnit Test Explorer is installed as well.

For me this workaround worked :
I disabled then enabled the PHPUnit Test Explorer extension.

I came back to the "test" tab, the tests were displayed and could be executed.

Hoping that can help.

Jean-Marc
  • 740
  • 8
  • 9