Why Rider doesn't discover tests in of the projects? Magic, certainly not :(
Hi,
a couple of days ago I started (in fact I come back to) using a Rider IDE when developing C# based project. I came to a weird situation when trying to run unit and integration tests, cause Rider to start them, but it couldn’t discover tests in one project. It seems weird, cause as I remember everything works fine with discovering those tests in Visual Studio or in a Cake script. I start digging into what could be wrong here. I thought that maybe there could be some problem in a csproj file which causes Rider to not discovered tests properly. I find out that the csproj for this project which couldn’t be discover by Rider test runner (but could be by Resharper test runner) looks like this:
At first glance, everything looks fine. I compare it with another csproj for a project for which tests were discovered correctly and it looks like this:
Yup this is it, I got you! It seems that rider decides if he has to scan some specific project(s) for tests only when this project contains in dependencies a Microsoft.Net.Test.Sdk but as it seems when rider scans csprojs it scans them taking into consideration a case sensitiveness, so when I change a microsoft.net.test.sdk to a Microsoft.Net.Test.Sdk, everything starts to work correctly.
So when you are using rider please be cautious that it could be case sensitive sometimes :)
#edit
It is already fixed and should work correctly in Rider 2018.2.