views:

25

answers:

1

My common scenario: I have a web app and a test project in the same solution. Maybe I'm missing something, but I can't test methods/snippets from the Immediate Window regardless of which project. MSDN alleges you can't use syntax like

?TestMethod123(args)

from the Immediate Window while in web type project. So, why can't I throw a method in my test project (same solution, mind you) without the [TestMethod] attribute and get some output there?

Often, I find myself needing to quickly test the output (read: Console output) of a few lines of code, but it doesn't merit a whole unit test, or I don't want to clutter my pretty test project with junk code I don't initially understand in the first place. Does Visual Studio provide a way for me to quickly test code snippets?

A: 

For quick-and-dirty checking of some dubious code I use the Snippet Compiler, which works wonderfully for that purpose.

For running a single or just a few unit tests, I would recommend using Resharper, or TestDriven.NET. They are both commercial solution, but both are well worth the bucks, especially if used in a professional environment.

SWeko
I've been looking at Snippet Compiler. It claims it can be integrated into Visual Studio, but I can't see how. Any ideas?
David
You can try playing with Tools Menu > External Tools. I mean add it there. Although I don't see it mentioned anywhere that it integrates with visual studio. Can you state any references please.
Ismail
It does not look like Snippet Compiler has been updated for years :-(
Jakob Christensen
I know, and it's a shame, because it's a great tool, especially if you are doing lots of algorithms.
SWeko