Creating Quick Tests in C#
Update on 5/2/07: This post has nothing to do with Unit Testing (it was written before I was aware of unit testing) but has to do with write little bits of code to try new stuff out. It is also only for VS03. For the current version (VS05), see this post: CoadNet VS Project Templates, Quick Code + Console App for C# in VS05
CoadTools Quick Test C# Project Template (setup .msi) for Visual Studio .NET 2003
Introduction
Very often I need to test a tidbit of code, do some research on a class, etc. In fact, I was creating several times as many quick code test projects as any other project need. I used to start a Console application, change it to a Windows Application, but still needed to add namespaces, etc. So I created a custom "New Project" template for Visual Studio .NET 2003. To use, just install, load VS.NET, choose "New Project"/"Visaul C# Projects"/"Quick Test", and you're good to go.
The Goal
The main goal was to minimize the time to test code. Just start VS.NET, choose the "Quick Test" project, and type code. I wanted to send output to the Trace (VS.NET Ouput Window) and have the most common namespaces already included. You can easily modify the template after it is installed to suite your own needs.
Compare and Contrast
A popular tool is Snippet Compiler, which is a stand-alone mini-IDE for testing code. This is a great tool, especially if you do not own VS.NET 2003. When testing, I find that I want the full VS.NET environment, which I'm most familiar with and productive in, and to perform quick MSDN help lookup and take advantage of the full debugging interface. Just a simple custom "New Project" template like this provides all these objectives in a simple manor.
Saving Code
When creating a new quick test project, I usually just store the project in "C:\Temp\Test". This way I keep my tests for future reference and they are out of the way.
Leave Feedback
This is completely free. All I ask is that you leave a feedback comment. :)
 |
| VS.NET 2003 "New Project" Dialog w/ Quick Test Project |
 |
| Code Template in VS.NET, Fully Customizable |
Screen captures have been brought to you by SnagIt. This is my first use of SnagIt, a powerful screen capture utility, and it is fantastic! Extremely easy to use (a big plus for me) and it includes additional editing tools.