jcansdale / TestDriven.Net-Issues

Issue tracking for TestDriven.Net
https://github.com/jcansdale/TestDriven.Net-Issues/issues
24 stars 2 forks source link

Add support for embedded VS SDK interop types in method parameters #94

Closed jcansdale closed 7 years ago

jcansdale commented 7 years ago

The new In-Proc (VS SDK) test runner wasn't able to find service objects when a target method parameter was an embedded interop type. The test runner wasn't able to automatically infer the location of the service type.

For example, take the following method:

        [STAThread]
        void DifferenceService(IVsDifferenceService differenceService)
        {
            Console.WriteLine(typeof(SVsDifferenceService));
            var file1 = // full path
            var file2 = // full path
            differenceService.OpenComparisonWindowFromCommandLineArguments($"\"{file1}\" \"{file2}\"");
        }

If IVsDifferenceService was an embedded interop type, the SVsDifferenceService type required to retrieve the service object isn't necessarily in the current assembly or even in a referenced assembly.

When the test runner notices that IVsDifferenceService is an embedded interop type, it could do a more extensive search for the SVsDifferenceService service type (e.g. search assemblies loaded in the current app domain).