When running ad-hoc tests on a VS SDK MEF component, make it so that locally defined MEF components are visible to the ImportingConstructor of the target component.
For example, executing the Go method below using Test With > In-Proc (VS SDK) should output the ExportedComponent:
[Export]
public class ComponentWithImport
{
ExportedComponent component;
[ImportingConstructor]
public Foo(ExportedComponent component)
{
this.component = component;
}
public void Go()
{
Console.WriteLine(component);
}
}
[Export]
public class ExportedComponent
{
}
When running ad-hoc tests on a VS SDK MEF component, make it so that locally defined MEF components are visible to the
ImportingConstructor
of the target component.For example, executing the
Go
method below usingTest With > In-Proc (VS SDK)
should output theExportedComponent
: