Thursday, June 12, 2008

Converting a Class Library Project to a Test Project

Here's a VisualStudio 2008 tip. Have you ever created a C# project of type "Class Library", and then later you want to change it to a Test Project? Here's how:

1. Edit the .csproj file in Notepad and insert the following line:


Just before the first tag in the file

2. Right-click the solution in Solution Explorer and Add New Item... Choose new Test Run Configuration.

3. If your test cases need some data files (such as xml files) you can either edit the Test Run Configuration and add them to Deployment, or add the attribute