Alex Rivera | Logout

How to debug a class library in Visual Studio

Asked 2010-01-08T13:07:31.170
16

I am working on a class library (DLL) project in Visual Studio 2008; programming in C#. In order to test my DLL I just created a second project that is a console application and in that project I can reference the first and run tests. Is there a simpler way of doing this? Can I just create another file within my class library project that has the tests in it and then somehow tell Visual Studio to run that file?

I know one way would be to add a text file to my project and then write my test code in JScript. Then in the Project settings on the debug menu I can tell it to Start External Program (JScript). Then, the name of my test file, test.js, goes in the Command Line Arguments box. But, I am wondering if there is a way to do it using C# code instead of JScript?

Edit
Report

1 Answer

9

Take a look at NUnit or other similar unit testing framework.

The "Team Developer" and "Team Suite" flavors of Visual Studio already have Microsoft's unit testing framework built in.

answered 2010-01-08T13:09:10.057

Your Answer