How to unit test a C# library launched from an external program?

L

lpcarignan

Hi all,

Right now, I'm debugging a C# library by starting an external
application. To do this, I go in the project settings of the C#
project, go in the Debug section and check the radio button "Start
external program". I then specify the application that will start my
library.

I was wondering how VS 2005 does this under the cover. I'm asking
this because in my situation, tons of objects from the external
program are created when my code is debugged. They are created
because the external app was launched first. I can't really re-create
all those objects because the external app is written in C++. It's
objects are accesible through COM.

The end goal is that I would like to run unit tests on my code. But
to run my unit tests, I need to launch the external app first. Since
my code access the COM objects of the external application, this
application needs to be running first.

Does anybody know how to do this? I'm a believer of TDD but I can't
find a way to do this in my development environment.

Thanks for you help,

Louis-Philippe
 
G

Guest

Your unit test class would need to have a SetUp or similar helper method that
would perform the various tasks (executing your external app first, etc)
necessary for successful test methods to be run.
Peter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top