Dotnet logo

.NET Tools

Essential productivity kit for .NET and game developers

How-To's

Looking at the unit testing improvements in Rider 2018.2

In our latest Rider 2018.2 version, we made a number of improvements to unit testing. We now allow for renaming and locking unit test sessions, resulting in a better unit testing experience. We’ve added the option to navigate to the Unit Test Explorer, working with multiple tests on the same test method, have better terminal support for Rider running on Linux and a few more improvements. Let’s have a look!

Renaming and locking unit test sessions

With Rider 2018.2, we have made working with Unit Test sessions better, by adding the ability to rename and lock sessions. In the following example, we are renaming a session in the Unit Test Explorer from the default name of Session.

Renaming a Session in the Unit Test Explorer

When you have created a Unit Test session that meets your needs, you can prevent adding new tests or removing tests from a session using the Lock Session functionality:

Lock Button in the Unit Test Explorer

Navigating from tests to unit test explorer

Another improvement we have made is navigating from a unit test method in the editor to the test in the Unit Test Explorer:

Navigating from a test method to the test in the Init Test Explorer

Working with multiple NUnit tests for a test method

To make the experience working with multiple unit tests for the same test method better, we fixed a bug for working with a large number of tests where the More… functionality was broken. It has been fixed, and it will now open the Unit Test Explorer and bring you to the tests for the test method.

Working with multiple NUnit tests for the same test method

Unit testing shortcuts

Many people don’t know how awesome Rider’s shortcuts are for unit testing. We have improved how developers work with our shortcuts by moving the unit test shortcuts from the Rider keymap into the Default keymap (it’s always possible to see the keyboard shortcuts from the Tests | Unit Tests Tool Window Actions menu).

Unit Tests Tool Window Actions

Remember that all of our shortcuts can be edited from the settings, too!

Unit Testing Keymap Settings

Other fixes and improvements

In addition to the fixes and improvements we looked at in this blog post, there are other areas that we have worked on to make your development and testing experience the best it can be:

  • You can now run and debug tests on Windows using the Mono framework;
  • You can discover and run unit tests in SDK-style projects which target .NET Framework without having to have .NET Core SDK installed on your computer;
  • We have fixed the navigation from the Unit Test Explorer to our Help content;
  • Finally, we have removed the Show log entries with severity option from settings. We did this since in Rider all logs are saved to a text file and that setting was not needed.

Download Rider 2018.2 now! We’d love to hear your feedback on these fixes and improvements!

image description