Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can ReSharper run unit tests automatically

Is it possible to automatically run unit tests while you work without compiling or running them manually? I am aware that NDepend allows you to do so, but I would prefer to use the ReSharper suite.

like image 379
Bytenibblr Avatar asked Jan 24 '15 19:01

Bytenibblr


People also ask

How do I make unit tests automatically?

To generate unit tests, your types must be public. Open your solution in Visual Studio and then open the class file that has methods you want to test. Right-click on a method and choose Run IntelliTest to generate unit tests for the code in your method. IntelliTest runs your code many times with different inputs.

How do I run unit tests with ReSharper?

Ctrl+U D on the toolbar. Ctrl+U D commands, which are also available in the main menu (ReSharper | Unit Tests) and in the context menu. To run or debug all tests in solution, choose ReSharper | Unit Tests | Run All Tests from Solution in the main menu or press Ctrl+U L .

How do you invoke a unit test?

To run your unit tests after each local build, open the settings icon in the Test Explorer toolbar and select Run Tests After Build.


2 Answers

This has been available since dotCover 10. See the dotCover documentation for details.

This adds a new panel "Continuous Testing Session" as well as a new status icon in the gutter.

Note that Visual Studio also has this feature, known as Live Unit Testing.


enter image description here

like image 139
Drew Noakes Avatar answered Sep 28 '22 18:09

Drew Noakes


Not possible with Resharper at the moment, you will need something like NCrunch that runs your unit tests continuously in the background, highlighting code that breaks them as you write it and fails your tests.

Edit: At the time of my response it wasn't possible to do this with ReSharper but now in Version 10 it is, see Drew Noakes's answer. You could still give NCrunch a try as it continuously runs your tests in the background even without doing an explicit save.

like image 29
Piers Myers Avatar answered Sep 28 '22 17:09

Piers Myers