public void AddComponentInstanceAndChildContainers()
		{
			var child = new WindsorContainer();
			Container.AddChildContainer(child);

			var clock1 = new EmptyServiceA();
			var clock2 = new EmptyServiceB();

			Container.Register(Component.For<IEmptyService>().Instance(clock2));
			child.Register(Component.For<IEmptyService>().Instance(clock1));

			Assert.AreSame(clock2, Container.Resolve<IEmptyService>());
			Assert.AreSame(clock1, child.Resolve<IEmptyService>());
		}
Beispiel #2
0
        public void AddComponentInstanceAndChildContainers()
        {
            var child = new WindsorContainer();

            Container.AddChildContainer(child);

            var clock1 = new EmptyServiceA();
            var clock2 = new EmptyServiceB();

            Container.Register(Component.For <IEmptyService>().Instance(clock2));
            child.Register(Component.For <IEmptyService>().Instance(clock1));

            Assert.AreSame(clock2, Container.Resolve <IEmptyService>());
            Assert.AreSame(clock1, child.Resolve <IEmptyService>());
        }
Beispiel #3
0
		public void AddComponentInstanceAndChildContainers()
		{
			IWindsorContainer parent = new WindsorContainer();
			IWindsorContainer child = new WindsorContainer();
			parent.AddChildContainer(child);

			IEmptyService clock1 = new EmptyServiceA();
			IEmptyService clock2 = new EmptyServiceB();

			parent.Kernel.Register(Component.For(typeof(IEmptyService)).Instance(clock2));
			child.Kernel.Register(Component.For(typeof(IEmptyService)).Instance(clock1));

			Assert.AreSame(clock2, parent.Resolve<IEmptyService>());
			Assert.AreSame(clock1, child.Resolve<IEmptyService>());
		}
Beispiel #4
0
        public void AddComponentInstanceAndChildContainers()
        {
            IWindsorContainer parent = new WindsorContainer();
            IWindsorContainer child  = new WindsorContainer();

            parent.AddChildContainer(child);

            IEmptyService clock1 = new EmptyServiceA();
            IEmptyService clock2 = new EmptyServiceB();

            parent.Kernel.Register(Component.For(typeof(IEmptyService)).Instance(clock2));
            child.Kernel.Register(Component.For(typeof(IEmptyService)).Instance(clock1));

            Assert.AreSame(clock2, parent.Resolve <IEmptyService>());
            Assert.AreSame(clock1, child.Resolve <IEmptyService>());
        }