public TransientLifecycleTester()
        {
            theContext   = MockRepository.GenerateMock <ILifecycleContext>();
            theLifecycle = new TransientLifecycle();

            theCache = MockRepository.GenerateMock <ITransientTracking>();
            theContext.Stub(x => x.Transients).Return(theCache);
        }
        public TransientLifecycleTester()
        {
            theContext   = Substitute.For <ILifecycleContext>();
            theLifecycle = new TransientLifecycle();

            theCache = Substitute.For <ITransientTracking>();
            theContext.Transients.Returns(theCache);
        }
        public TransientLifecycleTester()
        {
            theContext = Substitute.For<ILifecycleContext>();
            theLifecycle = new TransientLifecycle();

            theCache = Substitute.For<ITransientTracking>();
            theContext.Transients.Returns(theCache);
        }
Example #4
0
        private static ITransientTracking chooseTransientTracking(PluginGraph pluginGraph)
        {
            ITransientTracking transients = pluginGraph.TransientTracking == TransientTracking.DefaultNotTrackedAtRoot
                ? (ITransientTracking) new NulloTransientCache()
                : new TrackingTransientCache();

            return(transients);
        }
        public TransientLifecycleTester()
        {
            theContext = MockRepository.GenerateMock<ILifecycleContext>();
            theLifecycle = new TransientLifecycle();

            theCache = MockRepository.GenerateMock<ITransientTracking>();
            theContext.Stub(x => x.Transients).Return(theCache);
        }
Example #6
0
        public static IPipelineGraph BuildRoot(PluginGraph pluginGraph)
        {
            ITransientTracking transients = pluginGraph.TransientTracking == TransientTracking.DefaultNotTrackedAtRoot
                ? (ITransientTracking) new NulloTransientCache()
                : new TrackingTransientCache();

            return(new PipelineGraph(pluginGraph, new RootInstanceGraph(pluginGraph), null, pluginGraph.SingletonCache,
                                     transients));
        }
        public PipelineGraph(PluginGraph pluginGraph, IInstanceGraph instances, IPipelineGraph root, IObjectCache singletons, ITransientTracking transients)
        {
            _pluginGraph = pluginGraph;
            _instances = instances;

            if (root == null)
            {
                _root = this;
                _profiles = new Profiles(_pluginGraph, this);
                ContainerCache = singletons;
            }
            else
            {
                _root = root.Root();
                _profiles = root.Profiles;
                ContainerCache = new ContainerSpecificObjectCache();
            }

            _singletons = singletons;
            _transients = transients;
        }
Example #8
0
        public PipelineGraph(PluginGraph pluginGraph, IInstanceGraph instances, IPipelineGraph root, IObjectCache singletons, ITransientTracking transients)
        {
            _pluginGraph = pluginGraph;
            _instances   = instances;

            if (root == null)
            {
                _root          = this;
                _profiles      = new Profiles(_pluginGraph, this);
                ContainerCache = singletons;
            }
            else
            {
                _root          = root.Root();
                _profiles      = root.Profiles;
                ContainerCache = new ContainerSpecificObjectCache();
            }

            _singletons = singletons;
            _transients = transients;
        }
Example #9
0
 private void changeTransientTracking(TransientTracking transientTracking)
 {
     _pluginGraph.TransientTracking = transientTracking;
     _transients = chooseTransientTracking(_pluginGraph);
 }