I would like to run unit tests from .NET TEST EXPLORER, not the command line. I can run tests when navigating to the unit test directory and executing dotnet test
.
But selecting .NET TEST EXPLORER shows:
Please open or set the test project and ensure your project compiles
Is it related to the NUnit
nature of the test project?
Project does compile. How do I set the test project?
In VISUAL STUDIO CODE, select the Settings wheel (Manage) > Extensions > Workspace Settings > Test Project Path
Enter the relative path to the unit test project: MyProject.Test/MyProject.Test.csprojx
.
Select the Settings wheel (Manage)
-> Extensions
-> Workspace Settings
-> Test Project Path
Enter:
*Tests*
if you have "Tests" in your project's name.
Source: Interactive Unit Testing with .NET Core and VS Code By John V. Petersen
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With