Friday, October 28, 2005

Visual Studio 2005 Launch Event

are you going??

Well I am. It is probably going to be a cool party, with dinner and everything.
oh yes, and a couple of products will be release to.. :-)

The link you ask?
Launch Event

Wednesday, October 05, 2005

Test an internal class in .Net?

I recently ran into this problem. Like most of you we have separate projects for our unit tests. And off course we also have a helper to test private functions using reflection.
But how do you test an internal class?
The helper we have won't suffice. Because it needs an instance of the called class. So how do we do this? Again using reflection? Hmmm..
Well the solution is surprisingly easy.
We will link the internal class to our Test project.
To do this go to Add Existing Item -> Select File you wish to Link.
Now instead of clicking on the Open button, which will make a copy of the file in your project and we don't want that, click on the Drop Down and select Link file.
This will link the selected file to your test project, this way you can use the internal class, but the file is not actually copied to your Test project. And thus, code changes will automatically be used.
Easy, isn't it?