public void ExecutesBeforeObjectFactoryPostProcessing()
        {
            MockObjectFactoryPostProcessor mofp = new MockObjectFactoryPostProcessor();

            IConfigurableApplicationContext ctx = new XmlApplicationContext(false, "name", false, null);
            ctx.AddObjectFactoryPostProcessor(new DelegateObjectFactoryConfigurer(of => of.RegisterSingleton("mofp", mofp)));

            ctx.Refresh();
            Assert.IsTrue(mofp.Called);
        }
        public void ExecutesBeforeObjectFactoryPostProcessing()
        {
            MockObjectFactoryPostProcessor mofp = new MockObjectFactoryPostProcessor();

            IConfigurableApplicationContext ctx = new XmlApplicationContext(false, "name", false, null);

            ctx.AddObjectFactoryPostProcessor(new DelegateObjectFactoryConfigurer(of => of.RegisterSingleton("mofp", mofp)));

            ctx.Refresh();
            Assert.IsTrue(mofp.Called);
        }
        public void CanBeUsedToReconfigureAnApplicationContextOnRefresh()
        {
            MockObjectFactoryPostProcessor mofp = new MockObjectFactoryPostProcessor();

            IConfigurableApplicationContext ctx = new XmlApplicationContext(false, "name", false, null);
            ctx.AddObjectFactoryPostProcessor(new DelegateObjectFactoryConfigurer(delegate(IConfigurableListableObjectFactory of)
                {
                    of.RegisterSingleton("mofp", mofp);
                }));

            ctx.Refresh();

            mofp.Called = false;
            ctx.Refresh();
            Assert.IsTrue(mofp.Called);
        }
示例#4
0
        public void CanBeUsedToReconfigureAnApplicationContextOnRefresh()
        {
            MockObjectFactoryPostProcessor mofp = new MockObjectFactoryPostProcessor();

            IConfigurableApplicationContext ctx = new XmlApplicationContext(false, "name", false, null);

            ctx.AddObjectFactoryPostProcessor(new DelegateObjectFactoryConfigurer(delegate(IConfigurableListableObjectFactory of)
            {
                of.RegisterSingleton("mofp", mofp);
            }));

            ctx.Refresh();

            mofp.Called = false;
            ctx.Refresh();
            Assert.IsTrue(mofp.Called);
        }