How to write unit test for Visual Studio plugin?

Some of the plugin methods for which I would like to write unit tests accept COM objects passed directly to Visual Studio. For example:

public void OnConnection(object application, ext_ConnectMode connectMode, object addInInst, ref Array custom)
{
   DTE2 d = (DTE2)application;
   ...
}

Since these objects are not serializable, I cannot read unit test code from disk.

Besides creating instances of custom classes that implement the same COM-related interfaces and that have properties that return meaningless / questionable data, is there a way to test this way sort of without actually running Visual Studio?

+4
source share
1 answer

Unit Test . , , , COM-.

, . . , . .

Unit Tests . , . , Unit Testing .

, DTE

DTE

Unit Test Visual Studio AddIn VS DOM

+1

All Articles