Esempio n. 1
0
        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);
        }
Esempio n. 2
0
            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);
            }
Esempio n. 3
0
 public object Resolve(ObjectContainer container, RegistrationKey keyToResolve, ResolutionList resolutionPath)
 {
     return(instance);
 }
Esempio n. 4
0
 public object Resolve(ObjectContainer container, RegistrationKey keyToResolve, IEnumerable <Type> resolutionPath)
 {
     return(Instance);
 }
Esempio n. 5
0
            public object Resolve(ObjectContainer container, RegistrationKey keyToResolve, ResolutionList resolutionPath)
            {
                var obj = container.InvokeFactoryDelegate(factoryDelegate, resolutionPath, keyToResolve);

                return(obj);
            }
Esempio n. 6
0
 protected override object ResolvePerDependency(ObjectContainer container, RegistrationKey keyToResolve, ResolutionList resolutionPath)
 {
     return(container.InvokeFactoryDelegate(factoryDelegate, resolutionPath, keyToResolve));
 }
Esempio n. 7
0
 protected abstract object ResolvePerDependency(ObjectContainer container, RegistrationKey keyToResolve, ResolutionList resolutionPath);