A suite of integrated tools for creating, running, and managing tests to ensure code quality and reliability.
Thank you for reaching out.
The issue is not that the test or framework is wrong. The tests are running and failing correctly, which means Visual Studio can discover and execute them.
The real problem is that Visual Studio is unable to link the test result shown in Test Explorer back to the actual test file in the project. When you click Go to Test or Go to Code, Visual Studio does not know which source file to open, so nothing happens.
This link between the test result and the source file is created during build and test discovery. If that information is missing, outdated, or not refreshed, Test Explorer can still show and run tests, but navigation to the test code will not work.
So, the issue is only with navigation from Test Explorer to the test source, not with running the tests themselves or with xUnit.
Reference:
- Test Explorer – Run unit tests and navigate to code https://dori-uw-1.kuma-moon.com/visualstudio/test/run-unit-tests-with-test-explorer (Explains that Test Explorer relies on test discovery metadata to link test results back to source files for navigation.)
- Debug symbols (PDB files) and source navigation https://dori-uw-1.kuma-moon.com/visualstudio/debugger/specify-symbol-dot-pdb-and-source-files-in-the-visual-studio-debugger (Explains that Visual Studio uses symbols to map execution results back to source code.)
Please let us know if you require any further assistance, we’re happy to help. If you found this information useful, kindly mark this as "Accept Answer". So that others in the community facing similar issues can easily find the solution. Your contribution is highly appreciated.