MSTest tests errors are not displayed in Rider

Answered

Setup:

I am using Rider 2018.2.3 on Windows 10, without Visual Studio installed.

To make my MSTest tests work:

1. I installed "Agents for Visual Studio 2017" from https://visualstudio.microsoft.com/downloads/

2. Set "C:\Program Files (x86)\Microsoft Visual Studio\2017\TestAgent\Common7\IDE" in Rider Build/Unit Testing/MSTest settings:

Problem:

Tests containing errors either hang in "Pending..." or the option to make them run is grayed out.

The tests are not executed correctly because they contain errors, but these errors are not displayed in Rider.

A way to troubleshoot this is to run the same tests from a command prompt using:

MSTest /testcontainer:\Solution1\Tests\Debug\Test.dll

For example, in one case I had the error:

Test method marked with the [TestMethod] attribute must be non-static, public, does not return a value and should not take any parameter. for example: public void Test.Class1.Test(). Additionally, return-type must be Task if you are running async unit tests. Example: public async Task Test.Class1.Test2().

After fixing the error I was able to run the tests in Rider.

1
1 comment
Avatar
Permanently deleted user

JetBrains customer support answered me privately :

It is a good idea to have such inspections in Rider.
Here is an issue in our tracker. Please, feel free to vote for it and leave comments.

1

Please sign in to leave a comment.