public void transient_cache_of_nested_pipeline_graph_is_a_stateful_cache()
        {
            var plugins = PluginGraph.CreateRoot();

            var pipeline = PipelineGraph.BuildRoot(plugins);

            pipeline.ToNestedGraph().Transients.ShouldBeOfType <ContainerSpecificObjectCache>();
        }
        public void transient_cache_of_nested_pipeline_graph_is_a_stateful_cache()
        {
            var plugins = new PluginGraph();

            var pipeline = PipelineGraph.BuildRoot(plugins);

            pipeline.ToNestedGraph().Transients.ShouldBeOfType <LifecycleObjectCache>();
        }
        public void transient_cache_by_default_is_a_nullo()
        {
            var plugins = PluginGraph.CreateRoot();

            var pipeline = PipelineGraph.BuildRoot(plugins);

            pipeline.Transients.ShouldBeOfType <NulloTransientCache>();
        }
예제 #4
0
        public void default_lifecycle_not_set_on_any_level()
        {
            var graph = PluginGraph.CreateRoot();

            var pipeline = PipelineGraph.BuildRoot(graph).Profiles.For("Red");

            pipeline.Instances.DefaultLifecycleFor(typeof(IGateway))
            .ShouldBeNull();
        }
예제 #5
0
        public void build_root_for_tracked_transients()
        {
            var pluginGraph = PluginGraph.CreateRoot();

            pluginGraph.TransientTracking = TransientTracking.ExplicitReleaseMode;
            var graph = PipelineGraph.BuildRoot(pluginGraph);

            graph.Transients.ShouldBeOfType <TrackingTransientCache>();
        }
예제 #6
0
        public void build_root_for_default_tracking_style()
        {
            var pluginGraph = PluginGraph.CreateRoot();

            pluginGraph.TransientTracking = TransientTracking.DefaultNotTrackedAtRoot;
            var graph = PipelineGraph.BuildRoot(pluginGraph);

            graph.Transients.ShouldBeOfType <NulloTransientCache>();
        }
        public void singleton_is_just_the_plugin_graph_singletons()
        {
            var plugins = PluginGraph.CreateRoot();

            plugins.SingletonCache.ShouldNotBeNull();

            var pipeline = PipelineGraph.BuildRoot(plugins);

            pipeline.Singletons.ShouldBeTheSameAs(plugins.SingletonCache);
        }
예제 #8
0
        public void lifecyle_for_pluginType_not_explicitly_set_falls_back_to_parent()
        {
            var graph = PluginGraph.CreateRoot();

            graph.Families[typeof(IGateway)].SetLifecycleTo <SingletonLifecycle>();

            var pipeline = PipelineGraph.BuildRoot(graph).Profiles.For("Red");

            pipeline.Instances.DefaultLifecycleFor(typeof(IGateway))
            .ShouldBeOfType <SingletonLifecycle>();
        }
        public void lifecycle_for_pluginType_explicitly_set()
        {
            var graph   = new PluginGraph();
            var profile = graph.Profile("Red");

            profile.Families[typeof(IGateway)].SetLifecycleTo <SingletonLifecycle>();

            var pipeline = PipelineGraph.BuildRoot(graph).Profiles.For("Red");

            pipeline.Instances.DefaultLifecycleFor(typeof(IGateway))
            .ShouldBeOfType <SingletonLifecycle>();
        }
        public when_the_singleton_Lifecycle_ejects_all()
        {
            lifecycle = new SingletonLifecycle();

            disposable1 = new StubDisposable();
            disposable2 = new StubDisposable();

            pipeline = PipelineGraph.BuildRoot(PluginGraph.CreateRoot());

            lifecycle.FindCache(pipeline)
            .As <LifecycleObjectCache>()
            .Set(typeof(IGateway), new StubInstance("a"), disposable1);
            lifecycle.FindCache(pipeline)
            .As <LifecycleObjectCache>()
            .Set(typeof(IGateway), new StubInstance("b"), disposable2);
            lifecycle.FindCache(pipeline)
            .As <LifecycleObjectCache>()
            .Set(typeof(IGateway), new StubInstance("c"), new object());

            lifecycle.EjectAll(pipeline);
        }
예제 #11
0
        public void SetUp()
        {
            lifecycle = new SingletonLifecycle();

            disposable1 = new StubDisposable();
            disposable2 = new StubDisposable();

            pipeline = PipelineGraph.BuildRoot(new PluginGraph());

            lifecycle.FindCache(pipeline)
            .As <LifecycleObjectCache>()
            .Set(typeof(IGateway), new StubInstance("a"), disposable1);
            lifecycle.FindCache(pipeline)
            .As <LifecycleObjectCache>()
            .Set(typeof(IGateway), new StubInstance("b"), disposable2);
            lifecycle.FindCache(pipeline)
            .As <LifecycleObjectCache>()
            .Set(typeof(IGateway), new StubInstance("c"), new object());


            lifecycle.EjectAll(pipeline);
        }
예제 #12
0
 static StubBuildSession()
 {
     _pipeline = PipelineGraph.BuildRoot(_pluginGraph);
 }