コード例 #1
0
        public void default_lifecycle_is_explicitly_set()
        {
            var graph = PluginGraph.CreateRoot();
            graph.Families[typeof (IGateway)].SetLifecycleTo<SingletonLifecycle>();

            var root = new RootInstanceGraph(graph);
            root.DefaultLifecycleFor(typeof (IGateway)).ShouldBeOfType<SingletonLifecycle>();
        }
コード例 #2
0
        public void default_lifecycle_is_null_if_family_has_no_lifecycle()
        {
            var graph = PluginGraph.CreateRoot();
            graph.Families[typeof (IGateway)].SetDefault(new SmartInstance<StubbedGateway>());

            var root = new RootInstanceGraph(graph);
            root.DefaultLifecycleFor(typeof (IGateway)).ShouldBeNull();
        }
コード例 #3
0
        public void default_lifecycle_is_explicitly_set()
        {
            var graph = PluginGraph.CreateRoot();

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

            var root = new RootInstanceGraph(graph);

            root.DefaultLifecycleFor(typeof(IGateway)).ShouldBeOfType <SingletonLifecycle>();
        }
コード例 #4
0
        public void default_lifecycle_is_null_if_family_has_no_lifecycle()
        {
            var graph = PluginGraph.CreateRoot();

            graph.Families[typeof(IGateway)].SetDefault(new SmartInstance <StubbedGateway>());

            var root = new RootInstanceGraph(graph);

            root.DefaultLifecycleFor(typeof(IGateway)).ShouldBeNull();
        }
コード例 #5
0
        public void default_lifecycle_by_default_is_null()
        {
            var root = new RootInstanceGraph(PluginGraph.CreateRoot());

            root.DefaultLifecycleFor(typeof(IGateway)).ShouldBeNull();
        }
コード例 #6
0
 public void default_lifecycle_by_default_is_null()
 {
     var root = new RootInstanceGraph(PluginGraph.CreateRoot());
     root.DefaultLifecycleFor(typeof (IGateway)).ShouldBeNull();
 }