I have a excel plug-in that is working very perfectly. What it does is it the user give some input from excel sheet and the plug-in backend gets the data from API and update the excel columns. Everything is working fine for me.
Now, I want to write some unit test for it. I have written dozen of test for other projects using moq and other framework but did not find a way to wirte unit test.
Also, the plugin-In reads excel rows. How I can handle in test? Plug-in then update the excel rows. How I can handle this canse in test?
The most straightforward and easiest solution is to automate Excel, so you could grab real Excel objects and do the modifications.
In some cases you can mock Excel objects instead of real ones.
Read more about unit testing in Visual Studio in the Unit Test Your Code section of MSDN.