Hi Govert,
Thanks for your answer.
I tried to create a simple add-in with only a "Hello world" function
and I added a unit test with the same kind of code as earlier.
Unfortunately for me, Excel disappears normally, so it shows that
something is instantiated in my code and not destroyed.
I have some ideas and I will check them before giving any explanation,
if you are interested in.
For my unit tests, it is not complicated : as you can see in my
previous examples, I use VSTO in order to open a workbook (I could
also create a new one) and then I load my xll file helps to the
"RegisterXLL" function in Excel.Application object.
Then I can write some of my custom formulas in any cell and check the
written results.
In my case, some functions create new worksheets. That's why I want to
automatically verify what is displayed in the new sheet.
Obviously, functions that just return a parameter without creating any
excel object can be called inside the unit tests without using Excel.
But I think that it is also important to check that the call of those
functions through Excel works as well.
The only matter in that way is that Excel runs in another process than
my unit tests so I cannot handle the objects instantiated by my add-in
while the functions have been called through Excel. All I can do is
see the visible results in Excel, as a user would do.
If you have some questions about my tests, I would be happy to give
you more answers.
Ron