If this is your first time at unit testing, then VSTO might be a steep learning curve. As suggested by @Sam Holder, you might want to put some of your logic into a separate assembly to encourage you to separate your logic from your interactions with the office infrastructure.
That said, whilst you can't add the project using the normal approach of adding a reference to the project, you can add a reference to the output from that project using the Browse
option:
- Right click on the test project and select "Add Reference".
- In the Box the appears, click on the "Browse" button at the bottom.
- Navigate to the bin\debug folder of the VSTO project and select the projects dll.
- Click on OK.
Obviously, you will have had to have built the addin for the above to work.
You're going to face some other challenges if you start trying to create objects that rely on the office infrastructure. So, at a minimum you might need to add references to Microsoft.Office.Tools
, Microsoft.Office.Tools.Common
into your test project.