views:

157

answers:

3

I'm using Infinitest for continuous testing when I do java development and i really miss the instant feedback when I develop in .nET

How do I do continuous testing in C# & .NET?

EDIT: I'm not looking for continuous integration, like CruiseControl, TeamCity etc. It's an instant feedback tool that works with your IDE that I'm looking for

+5  A: 

If you're using Visual Studio 2008 or 2010, you should take a look at the extension Continuous Testing for Visual Studio.

Note that it does not run the tests when you save, but rather on each build.

Lasse V. Karlsen
Thank you, that's exactly what I'm looking for. "on each build" is pretty good too. .NET needs to compile to dll before testing anyway, so a full compile on each save might be to CPU intensive.
Sebastian
Test it before you accept my answer please, it doesn't always work for me, I don't know why, but it might not actually solve anything for you either. It works on a smallish test project, but not on my class library.
Lasse V. Karlsen
Good idea, I'll unaccept the answer and re-evaluate after my test
Sebastian
I've had no luck in getting it to work. The addin doesn't seem to be available in VS2008, and it doesn't run on build either. Must be some sort of config issue i suppose
Sebastian
Continuous Testing is available for both VS08 and VS10, see the link provided by @Lasse V. Karlsen. If you experience issues, please provide feedback (preferably material (i.e. test solutions) for reproducing issues).
Håvard S
Oh, I can find the installer and run it, it just doesn't show up in the list of addins for VS. I'd love to give feedback and a test solution, but where do you want it?
Sebastian
You can contact me on Twitter (@havardstranden or @ContinuousTest), or e-mail me (continuoustesting AT <the domain that @Lasse V. Karlsen linked to>).
Håvard S
After a pleasant bit of dialogue with the author, he's managed to iron out a few bugs. It's now working great on both VS2008 and VS2010, running on a 64-bit Windows 7. I've only tested it on a small project, so mileage may varyI'm so pleased with it that I wrote a blog post about it: http://makeitfaster.wordpress.com/2010/06/29/continuous-testing-with-ide-integration/
Sebastian
+1  A: 

Although it does do more, CruiseControl.NET can do continous testing when it's integrated with NUnit.

I also find the continous feedback of testing and building to be really useful.

Joe R
+2  A: 

I would recommend using a continuous integration server like TeamCity. It also provides a plugin for Visual Studio which allows you to build your project and run unit tests on it from within the IDE.

Philippe Leybaert
I use TeamCity and it has the added bonus of allowing Continuous Integration on Java and .Net projects in the same one instance of TeamCity whereas with CruiseControl you would need an instance of CruiseControl for Java and a different instance of CruiseControl.Net running.
Wysawyg
+1 for TeamCity, but it doesn't do what was asked for, which was basically running all unit tests after each save.
Lasse V. Karlsen
@Lasse: indeed. It's just a suggestion for an alternative.
Philippe Leybaert
I should have been clearer, and mentioned that I wasn't looking for a CI server. But thanks for answering :)
Sebastian