Visual Studio 2013 Doesn't Discover Unit Tests

Visual Studio 2013 running unit test

You don't mention why you want to do this, so I'll just answer blind.

If you run your console app without debugging, then you can run your unit tests at the same time.

To run without debugging, use Ctrl+F5 (DEBUG -> Start Without Debugging).

Alternatively, open your console app's project folder, go to the bin\Debug folder and double-click on <your_app>.exe.


FWIW it doesn't sound like a very good idea to do this. Unit tests are meant to be runnable completely separately from your application.

No tests found to run - while debugging/running Unit test cases -- Visual studio 2017 15.5.1

Problem

If I understand you correctly, this is something you observe:

when you run the tests, the following can be seen in the console:

[4/3/2018 2:26:13 PM Informational] ------ Run test started ------
[4/3/2018 2:26:14 PM Warning] No test is available in d:\...\UnitTestProject1.dll. Make sure that test discoverer & executors are
registered and platform & framework version settings are appropriate and try
again.

and the test explorer shows:

no test found to run

What could have happened, and it happened to me a couple of times, that the test discovery is set up for another architecture than your currently set one.

Example

Your current configuration is x64

current configuration

but, the default test settings might have another one (e.g. x86):

default test settings

Solution

If you _align the test settings with your current architecture (x86 → x64), the tests should run.

successful run

Manual cleanups should not be necessary nowadays, if the solution is configured consistently



Related Topics



Leave a reply



Submit