How do I do continuous testing in .NET?
Asked Answered
D

4

10

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

Dogwatch answered 15/6, 2010 at 9:57 Comment(0)
P
8

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.

Prismatoid answered 15/6, 2010 at 10:12 Comment(8)
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.Dogwatch
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.Prismatoid
Good idea, I'll unaccept the answer and re-evaluate after my testDogwatch
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 supposeDogwatch
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).Stadiometer
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?Dogwatch
You can contact me on Twitter (@havardstranden or @ContinuousTest), or e-mail me (continuoustesting AT <the domain that @Lasse V. Karlsen linked to>).Stadiometer
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 vary I'm so pleased with it that I wrote a blog post about it: makeitfaster.wordpress.com/2010/06/29/…Dogwatch
B
20

I discovered another extension for VisualStudio that is really helpful: NCrunch http://www.ncrunch.net/ What I really like about it is that it runs the tests of your code in the background while you are typing (no saving/build required), it runs only tests that are influenced by changed code and it automatically shows which lines in your code are covered by passing tests/by failing tests and which lines are not covered. And it supports NUnit, MS Test, Xunit, MbUnit, MSpec :)

Breviary answered 12/10, 2011 at 10:11 Comment(0)
P
8

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.

Prismatoid answered 15/6, 2010 at 10:12 Comment(8)
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.Dogwatch
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.Prismatoid
Good idea, I'll unaccept the answer and re-evaluate after my testDogwatch
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 supposeDogwatch
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).Stadiometer
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?Dogwatch
You can contact me on Twitter (@havardstranden or @ContinuousTest), or e-mail me (continuoustesting AT <the domain that @Lasse V. Karlsen linked to>).Stadiometer
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 vary I'm so pleased with it that I wrote a blog post about it: makeitfaster.wordpress.com/2010/06/29/…Dogwatch
F
1

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.

Fallal answered 15/6, 2010 at 10:30 Comment(0)
L
1

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.

Ludendorff answered 15/6, 2010 at 10:34 Comment(4)
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.Estey
+1 for TeamCity, but it doesn't do what was asked for, which was basically running all unit tests after each save.Prismatoid
@Lasse: indeed. It's just a suggestion for an alternative.Ludendorff
I should have been clearer, and mentioned that I wasn't looking for a CI server. But thanks for answering :)Dogwatch

© 2022 - 2024 — McMap. All rights reserved.