views:

518

answers:

9

I have been trying to find a tool similar to JUnit Max for Visual Studio.

Preferably, the tool would work with Visual Studio 2008 Professional and NUnit.

For those who are apparently unable to click through to the JUnit Max site, here is the description.

JUnit Max is a continuous testing plug-in for Eclipse that helps programmers stay focused on coding by running tests intelligently and reporting results unobtrusively. Every time you save a Java file, Max runs your tests and reports errors in the same format as compile errors.

Max fails fast, running the tests most likely to fail first. You only have to pay close attention to test results for a second (literally) before getting back to coding, even if you have a long-running test suite

Try thinking of it like this...

Visual Studio detects and highlights syntax errors. I would like to see unit-test errors highlighted in the IDE just like syntax errors.

BenA has provided the best solution so far. Even so, his solution is not quite as good as the JUnit Max approach.

edit

I suppose that a JUnit Max-like tool does not yet exist for Visual Studio, or if it does, it's not widely known.

Thanks again to everyone who attempted to answer.

A: 

I think you want to automatically check out your code from the repository, compile it, run all unit test and send a report via email to all project members? Right?

If so, you are searching for the wrong term. You are looking for "continious integration".

Try products like: CruiseControl.NET or TeamCity.

Alexander
That is not what I'm looking for. Please examine the link I posted for an example of continuous unit testing. Thanks for the answer though.
dss539
For me there is no difference between running the test on a dedicated server (on check in) or your lokal computer (on saving)...except the performance you need when compiling the programm on every file save.
Alexander
There are several differences. The biggest one for me is the IDE integration. Another useful difference is that you don't check in broken code then discover that the test fails. You discover that the test fails as soon as you recompile. And the "most important" tests run first so you don't have to wait for the entire test run. Again, I urge you to please follow the link in my question to see how JUnit Max provides continuous unit testing.
dss539
TeamCity gives you IDE integration
Yishai
A: 

Have you looked at CruiseControl

I haven't used it personally but another dev team at my old job used it for continuous integration/Continuous builds on their project.

Theres a good article on CodeProject re: Continuous Integration with CruiseControl.net which covers NUnit Testing & CHM Documentation Builds as well

Eoin Campbell
I have heard good things about CruiseControl as well, but I'm not looking for continuous integration, I'm looking for continuous unit testing. Thanks for the tip though.
dss539
+5  A: 

It's not quite a plugin solution, but the NUnit GUI runner can do what you're after. You can change the settings so that it re-runs the last test run whenever your test assembly is modified. Hence when you re-compile all your tests will be run again (assuming your last test run ran every test of course).

You may already have this setup if you're already using NUnit, but you can also add the GUI runner to Visual Studio as an external tool, so that you can open it from within Visual Studio, with your test assembly already loaded. Again, this integration can be instantiated from within the GUI runner's settings dialog.

More information is available on the NUnit site, I'd link it but I'm too new a user!

EDIT: Another solution would be to add a post build event to your project, passing your test assembly to the NUnit runner. As described here. I appreciate that this still doesn't address the test prioritization aspect, though.

BenA
Thanks, BenA. That's an almost-solution, but the IDE integration and test-prioritization make the whole process a lot smoother.
dss539
A: 

TestDriven.NET

Joe Schneider
We use TestDriven.Net. Works great, no complaints.
David B
TestDriven.NET is great but it does not support continuous unit testing currently. I get the feeling that BenA is the only person who read and understood my question. How can I reword my question so people stop confusing continuous integration and standard unit testing with the concept of continuous unit testing?
dss539
Maybe start by explaining how JUnit Max works. I understood your question as soon as I read the link. :)
Kai Wang
@Kai Wang - Thanks for the suggestion. I've copy/pasted some text from their site and reworded the question.
dss539
A: 

If I understand correctly, your looking for something like ReSharper. ReSharper has a very nice, integrated unit test runner that lets you run full suites or individual tests. It has a nice test result browser, which can make it very easy to jump strait to code that is causing exceptions and whatnot. ReSharper isn't free, but in addition to integrated unit testing, it offers a TON of other usability features and improvements that integrate with Visual Studio.

If TestDriven.NET isn't good enough, ReSharper will definitely serve your needs.

jrista
he is not looking for an IDE testrunner, he is looking for an integrated continious tester
Matt Briggs
+1  A: 

Team City will let you run personal builds, so it will not check in the broken code. Only after all unit tests pass will it check in the code. Is that what you are after?

epitka
Not exactly, no. Check out the JUnit Max slideshow for details.
dss539
I looked at the first page and slide shows and I think that Team City can do that too with Risk Test Reordering. Take a look at http://www.jetbrains.net/confluence/display/TCD4/Risk+Tests+Reordering+in+Custom+Test+Runner.
epitka
@epitka - That's pretty cool. Does Team City also highlight the failing lines in the IDE? I've downloaded Team City, but I haven't installed or configured it yet.
dss539
I don't think it does that.
epitka
epitka - I installed TeamCity and I don't see any "personal builds" feature. Aside from that, I could not get it to work on my system. I am not able to run the build agent service under my user account, I have to run it as SYSTEM. That's a problem for the VCS I'm required to use, though. :(
dss539
Personal build is accessed through TeamCity>Remote Run in VS2008, but you have to be able to log into your server first.
epitka
A: 

There's no Visual Studio equivalent that I'm aware of, but if you're an IntelliJ user you can use Infinitest. Infinitest is also free, which is a nice perk.

A: 

i think you are searching for MSBuild with NUnit,

Avram
+1  A: 

i've been looking for the same thing ever since seeing junitmax run on eclipse, as far as i can tell there is nothing like it for the .net platform yet :(

the best available solution seems to be 'run tests on compile'. there's an interesting blog post about 'Extreme continuous integration'. you can at least run the tests on a seperate machine this way.

Bwing
That's a helpful link. Thanks.
dss539