I have been trying out the Jetbrains Rider product – found here.
I wanted to automatically run tests when files had been saved. It took me a little bit to get this up and going (getting the right combination and setup). This may save someone the effort.
Note: Done on Mac OS X
- Within Rider
- Go to Preferences -> Tools -> File Watchers
- Add File Watcher -> Custom
- Enter a name. I called mine: “UnitTestWatcher”
- Set the FileType and Scope. Mine are: Any, All Places. You could be more restrictive
- Program: /usr/local/share/dotnet/dotnet (You can find this path under the Build, Execution, Deployment – in the Preferences screen we launched the File Watchers from)
- Arguments: test
- Other options -> Working directory: /Users/[your user]/[path to the location of your csproj file containing the tests]
- Further down the setup, uncheck “Immediate file synchronisation” (unless you want the unit tests to run every time the file is updated – and not necessarily saved)
- Click -> ‘Ok’
- Click -> ‘Save’
Now you should be able to execute unit tests every time you save a file.
Rider may require a restart.