Exemplo n.º 1
0
        public void HandlerFilterGetsCalledLikeExpected()
        {
            Container.Register(Component.For <ISomeService>().ImplementedBy <FirstImplementation>(),
                               Component.For <ISomeService>().ImplementedBy <SecondImplementation>(),
                               Component.For <ISomeService>().ImplementedBy <ThirdImplementation>());

            var filter = new TestHandlersFilter();

            Container.Kernel.AddHandlersFilter(filter);

            Container.ResolveAll <ISomeService>();

            Assert.IsTrue(filter.OpinionWasChecked, "Filter's opinion should have been checked once for each handler");
        }
Exemplo n.º 2
0
		public void HandlerFilterGetsCalledLikeExpected()
		{
			Container.Register(Component.For<ISomeService>().ImplementedBy<FirstImplementation>(),
			                   Component.For<ISomeService>().ImplementedBy<SecondImplementation>(),
			                   Component.For<ISomeService>().ImplementedBy<ThirdImplementation>());

			var filter = new TestHandlersFilter();
			Container.Kernel.AddHandlersFilter(filter);

			Container.ResolveAll<ISomeService>();

			Assert.IsTrue(filter.OpinionWasChecked, "Filter's opinion should have been checked once for each handler");
		}