In most unit test tutorials I follow it has me create a second unit test project and then add a solution/project reference from the test project to the other project.
I have a VSTO addin, and when I go to add the reference I don't see anything listed under Solution > Project.
Why is this? How else can I add a reference to the addin project to test it?
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: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.