public void Can_chain_extensions()
        {
            var a         = new A();
            var collector = new CollectItemsExtension();

            Kernel.Register(AddResolveExtensions(Component.For <A>(), collector, new ReturnAExtension(a)));
            Kernel.Resolve <A>();
            Assert.AreSame(a, collector.ResolvedItems.Single());
        }
        public void Can_proceed_and_inspect_released_value_on_transinet()
        {
            var collector = new CollectItemsExtension();

            Kernel.Register(WithReleaseExtensions(Component.For <DisposableFoo>().LifeStyle.Transient, collector));
            var a = Kernel.Resolve <DisposableFoo>();

            Kernel.ReleaseComponent(a);
            Assert.AreEqual(1, collector.ReleasedItems.Count);
            Assert.AreSame(a, collector.ReleasedItems[0]);
        }
        public void Can_proceed_and_inspect_returned_value()
        {
            var collector = new CollectItemsExtension();

            Kernel.Register(AddResolveExtensions(Component.For <A>(), collector));
            Kernel.Resolve <A>();
            var resolved = Kernel.Resolve <A>();

            Assert.AreEqual(2, collector.ResolvedItems.Count);
            Assert.AreSame(resolved, collector.ResolvedItems[0]);
            Assert.AreSame(resolved, collector.ResolvedItems[1]);
        }