How to run tests during debugging

I have been using the ReSharper test runner in Visual Studio for quite some time, and there is one thing that I cannot understand about.

I used to have some integration tests in my solution that ran web requests on my local web server. I used to be able to run my web application in debug mode and then run the test using the Resharper test runner in the same instance of Visual Studio (which is currently starting a debugging session), and the test will work fine. The breakpoints in my application were deleted, and I was able to debug requests sent from the test.

However, when I tried to do the same for a new project, the tests did not run. When I run any test, Visual Studio displays a modal request box Do you want to stop debugging?. Why can't I run tests during an active debugging session? What determines the possibility of this? Visual Studio version? Decisive version? Unit testing unit (I am currently using MSTest)?

+4
source share
1 answer

I think I saw this behavior before, it seems to be caused by the fact that Resharper felt the need to always build a project / solution before running tests.

Try changing the build policy to Never (at least first) from the Unit Test Sessions window:

enter image description here

+9

Source: https://habr.com/ru/post/1657723/


All Articles