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?
source
share