13
votes

Is it possible to enable Resharper to automatically run all unit tests within a solution automatically when performing a local build using Visual Studio? I believe NUnit has an option "re-run last tests run" but I don't see such an option through Resharper or VS.

Thanks in advance

JP

[Edit] This may or may not matter, but I should point out that I am a one-man-team writing a medium sized application.

4

4 Answers

11
votes

Posting this one for anyone that comes across it in the future:

If you're running Visual Studio 2012, someone wrote a plugin that will do exactly what you are looking for: http://visualstudiogallery.msdn.microsoft.com/5dca9c5c-29cf-4fd7-b3ff-573e5776f0bd

8
votes

I don't think ReSharper has that option, but you could always turn to something like NCrunch or Continuous Testing one of the other continuous testing frameworks for .NET. Just be aware that they are still fairly new and a little rough around the edges.

3
votes

I suggest creating a build script (MSBuild, nAnt, rake, whatever) - use this script to build your solution then run tests on it.

Separating your build process from your IDE will allow you to add more things to the build (other types of tests, static checks, style checks etc).

See this blog entry on the subject.

2
votes

You need dotCover, which is technically part of ReSharper Ultimate. dotCover is JetBrains' testing coverage extension. Once you have this extension there is a "Continuous Testing" feature that you can turn on and configure it to run tests on build, save, etc in addition to code coverage.

dotCover Continuous Testing

I think you're on the right track though, test early and as often as possible while you are writing the code.