public override void RegisterGlobalContainerDefaults(BoDi.ObjectContainer container) { base.RegisterGlobalContainerDefaults(container); var runtimePluginLocator = new Mock <IRuntimePluginLocator>(); runtimePluginLocator.Setup(m => m.GetAllRuntimePlugins()).Returns(new List <string>() { "aPlugin" }); runtimePluginLocator.Setup(m => m.GetAllRuntimePlugins(It.IsAny <string>())).Returns(new List <string>() { "aPlugin" }); var pluginLoaderStub = new Mock <IRuntimePluginLoader>(); var traceListener = container.Resolve <ITraceListener>(); pluginLoaderStub.Setup(pl => pl.LoadPlugin(It.IsAny <string>(), traceListener)).Returns(_pluginToReturn); container.RegisterInstanceAs <IRuntimePluginLocator>(runtimePluginLocator.Object); container.RegisterInstanceAs <IRuntimePluginLoader>(pluginLoaderStub.Object); }
public override void RegisterDefaults(BoDi.ObjectContainer container) { base.RegisterDefaults(container); var pluginLoaderStub = new Mock <IRuntimePluginLoader>(); pluginLoaderStub.Setup(pl => pl.LoadPlugin(It.IsAny <PluginDescriptor>())).Returns(pluginToReturn); container.RegisterInstanceAs <IRuntimePluginLoader>(pluginLoaderStub.Object); }
public object Resolve(ObjectContainer container, RegistrationKey keyToResolve, ResolutionList resolutionPath) { return(instance); }
public object Resolve(ObjectContainer container, RegistrationKey keyToResolve, IEnumerable <Type> resolutionPath) { return(Instance); }
public object Resolve(ObjectContainer container, RegistrationKey keyToResolve, ResolutionList resolutionPath) { var obj = container.InvokeFactoryDelegate(factoryDelegate, resolutionPath, keyToResolve); return(obj); }
protected override object ResolvePerDependency(ObjectContainer container, RegistrationKey keyToResolve, ResolutionList resolutionPath) { return(container.InvokeFactoryDelegate(factoryDelegate, resolutionPath, keyToResolve)); }
protected abstract object ResolvePerDependency(ObjectContainer container, RegistrationKey keyToResolve, ResolutionList resolutionPath);