I'm trying to create an add-in for VS2008 to automate the unit tests. The test classes are located in a different project of the same solution. After the test class file is generated, I want to add it to that project automatically and make it the active document.
I could easily locate the test project, and I also found that:
testProject.DTE.ItemOperations.AddExistingItem(fileName)
can be used to add an existing item to a project. However, this call always adds the item to the current project, instead of the testProject. I'm sure there must be an easy way to do it, but I couldn't figure it out.
Your help is much appreciated.