public void when_building_an_instance_use_the_register_the_stack_frame()
        {
            var recordingInstance       = new BuildSessionInstance1();
            ConfiguredInstance instance =
                new ConfiguredInstance(typeof(ClassWithRule)).Child("rule").Is(recordingInstance);
            var session = new BuildSession(new PluginGraph());

            session.CreateInstance(typeof(IClassWithRule), instance);

            recordingInstance.Root.ConcreteType.ShouldEqual(typeof(ClassWithRule));
            recordingInstance.Root.RequestedType.ShouldEqual(typeof(IClassWithRule));
            recordingInstance.Root.Name.ShouldEqual(instance.Name);

            recordingInstance.Current.ConcreteType.ShouldEqual(typeof(ColorRule));
            recordingInstance.Current.RequestedType.ShouldEqual(typeof(Rule));
            recordingInstance.Current.Name.ShouldEqual(recordingInstance.Name);
        }
예제 #2
0
        public void when_building_an_instance_use_the_register_the_stack_frame()
        {
            var recordingInstance       = new BuildSessionInstance1();
            ConfiguredInstance instance =
                new ConfiguredInstance(typeof(ClassWithRule)).Ctor <Rule>("rule").Is(recordingInstance);
            var session = BuildSession.Empty();

            session.FindObject(typeof(IClassWithRule), instance);

            recordingInstance.Root.ConcreteType.ShouldEqual(typeof(ClassWithRule));
            recordingInstance.Root.RequestedType.ShouldEqual(typeof(IClassWithRule));
            recordingInstance.Root.Name.ShouldEqual(instance.Name);

            recordingInstance.Current.ConcreteType.ShouldEqual(typeof(ColorRule));
            recordingInstance.Current.RequestedType.ShouldEqual(typeof(Rule));
            recordingInstance.Current.Name.ShouldEqual(recordingInstance.Name);
        }
예제 #3
0
        public void when_building_an_instance_use_the_register_the_stack_frame()
        {
            var recordingInstance = new BuildSessionInstance1();
            ConfiguredInstance instance =
                new ConfiguredInstance(typeof (ClassWithRule)).Ctor<Rule>("rule").Is(recordingInstance);
            var session = BuildSession.Empty();

            session.FindObject(typeof (IClassWithRule), instance);

            recordingInstance.Root.ConcreteType.ShouldEqual(typeof (ClassWithRule));
            recordingInstance.Root.RequestedType.ShouldEqual(typeof (IClassWithRule));
            recordingInstance.Root.Name.ShouldEqual(instance.Name);

            recordingInstance.Current.ConcreteType.ShouldEqual(typeof (ColorRule));
            recordingInstance.Current.RequestedType.ShouldEqual(typeof (Rule));
            recordingInstance.Current.Name.ShouldEqual(recordingInstance.Name);
        }
예제 #4
0
        public void when_building_an_instance_use_the_register_the_stack_frame()
        {
            var recordingInstance = new BuildSessionInstance1();
            ConfiguredInstance instance =
                new ConfiguredInstance(typeof (ClassWithRule)).Child("rule").Is(recordingInstance);
            var session = new BuildSession(new PluginGraph());

            session.CreateInstance(typeof (IClassWithRule), instance);

            recordingInstance.Root.ConcreteType.ShouldEqual(typeof (ClassWithRule));
            recordingInstance.Root.RequestedType.ShouldEqual(typeof (IClassWithRule));
            recordingInstance.Root.Name.ShouldEqual(instance.Name);

            recordingInstance.Current.ConcreteType.ShouldEqual(typeof (ColorRule));
            recordingInstance.Current.RequestedType.ShouldEqual(typeof (Rule));
            recordingInstance.Current.Name.ShouldEqual(recordingInstance.Name);
        }