Unit testing of VSTO projects

In most unit test tutorials, I follow it to create a second unit test project, and then add a link to the project / project from the test project to another project.

I have added VSTO, and when I go to add the link, I see nothing in the list under Solution> Project.

Why is this? How else can I add a link to the addin project to test it?

+1
source share
2 answers

If this is your first time unit testing, then VSTO can be a steep learning curve. As suggested by @Sam Holder, you can put part of your logic in a separate assembly to encourage you to separate your logic from interaction with the office infrastructure.

However, while you cannot add a project using the usual approach of adding a link to a project, you can add a link to the output from this project using the option Browse:

  • Right-click on the test project and select Add Link.
  • In the window that appears, click the "Browse" button below.
  • Go to the bin \ debug folder of the VSTO project and select the dll of the projects.
  • Click OK.

Obviously, you had to create an add-on for the above.

, , . , Microsoft.Office.Tools, Microsoft.Office.Tools.Common .

+3

, , , . . , VSTO addin, .

+1

Source: https://habr.com/ru/post/1681528/


All Articles