I'm very new to Unit Testing and trying to implement NUnit in a C# Dotnet Core 3.1 project. I think the test is working, but I'd really like to debug (and single-step through) the test to make sure everything is working.
However, when I right-click on a test and select "debug", two things happen (or not):
I found a thread on Stackoverflow that said you had to set up an external program in the debug settings, but VS2022 does not have those screens or settings.
UPDATE: I created a stupid-simple dotnet core console project (and added NUnit in the same way) and debugging works just fine. So, it's something about the project I'm trying to add test to: it is a dotnet core 3.1 web project.
2nd UPDATE: so I created a stupid-simple dotnet core web project (and added NUnit) and debugging works just fine. So, it's something about my project (and probably related to that error message saying it can't find project guid: xxxxxxx (don't have it any longer).
3rd UPDATE: so I DELETED the NUnit test project (again) and re-created it and left it dirt-simple (just whatever VS2022 creates on open) and it debugs! Now to start adding code and find out what breaks it!
Thoughts?
TIA,
So, there's nothing that caused debugging to not work. After deleting the NUnit test project (for the third time) and re-creating the tests (and oneTimeStartup code) from scratch again, the NUnit tests debug (and breakpoints stop) and there's no error saying some project guid could not be found. Go figure.
So, if this is happening to you, you're not crazy. Delete and recreate the NUnit test project a few times (and take baby steps in implementing the tests) and it will eventually work!