How do I do continuous testing in .NET?

2020-06-12 05:58发布

问题:

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

回答1:

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.



回答2:

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 :)



回答3:

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.



回答4:

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.