Previously TestDriven.Net was silently falling back to retrieving IComponentModel as a service by inferring its SComponentModel service type. This gave the misleading impression that IComponentModel as available as a MEF service.
What should happen
When a parameter attributed with [Import], the test should fail and expose any information about why the import couldn't be satisfied.
For example, attempting to execute this method using Test With > In-Proc (VS SDK):
1) No exports were found that match the constraint:
ContractName Microsoft.VisualStudio.ComponentModelHost.IComponentModel
RequiredTypeIdentity Microsoft.VisualStudio.ComponentModelHost.IComponentModel
What is happening
For example, the following snippet should work because Visual Studio does export
ICompositionService
:The following snippet shouldn't work because Visual Studio doesn't export
IComponentModel
(but it does expose it as a service viaSComponentModel
):Previously TestDriven.Net was silently falling back to retrieving
IComponentModel
as a service by inferring itsSComponentModel
service type. This gave the misleading impression thatIComponentModel
as available as a MEF service.What should happen
When a parameter attributed with
[Import]
, the test should fail and expose any information about why the import couldn't be satisfied.For example, attempting to execute this method using
Test With > In-Proc (VS SDK)
:Should output the following:
Without the
[Import]
it should output: