2
votes

I'm using xUnit (1.9.2. version) + ReSharper + xUnit.net Test Support for ReSharper 9 extension for ReShaper.
For some reason ReSharper unit test runner doesn't discover all existing unit tests, while Test Explorer does. All test classes are marked as public.
Any clue?

1
Can you share some details about the tests that don't get discovered? Are they nested tests, static, public, private, etc.?citizenmatt
All of them are public, not nested and not static. Workaround that I've found in order for them to be discovered is to go to the test class and use ReSharpers 'Run unit test' from the .cs file directly. Just then they get discovered in the unit test runner, but only for that given class. So, I have to go manually from test class to test class and do this iteratively.dragan.stepanovic
First thing I'd try is to clear the caches (ReSharper → Options → General → Clean Caches and restart VS), see if that kickstarts ReSharper again. Failing that, any chance you can get me a copy of the solution? Raise an issue against github.com/xunit/resharper-xunitcitizenmatt

1 Answers

0
votes

In case anyone out there is struggling with R# not detecting some/all unit-tests:

In my case deep-cleaning the solution or restarting my machine didn't cut it. I had to shut down visual studio and reset its user-land settings + temp data completely + re-install the latest and greatest R#. To reset the user-land settings of VS by hand try this:

https://www.matteopozzani.com/visual-studio-cache-cleanup/

  1. Close Visual Studio (ensure devenv.exe is not present in the Task Manager)
  2. Delete the %USERPROFILE%\AppData\Local\Microsoft\VisualStudio[version]\ComponentModelCache directory
  3. You could also need to cleanup your user's temp folder[1:1]. it is usually located under: %USERPROFILE%\AppData\Local\Temp.