Many calls to external applications. How to test?
There is a Visual Studio plugin. The plugin uses VS SDK, few external applications and a database.
A simplified version of the plugin is:
Use VS SDK to get information about the current solution and its projects
for i=1 to n do
Call external application i (create process, add arguments, wait for result)
Collect results from application i in global DataObject
end for
store DataObject in database
That's all. A lot of external calls, aggregate the results and store.
Now the question is: how do you test it? Of course, one can write a functional test but I would like to have unit tests for each step (each app call or db access).
One option would be to mock each external app, database and (?)VS SDK but seems real开发者_StackOverflow社区ly complicated.
Is there a clever way of testing such applications?
For a unit test I can't think of any other way but mocking the external dependencies here.
I would wrap the calls to the external app in an Interface and use a mocking framework to verify your app calls the external app correctly.
精彩评论