public void CanBeUsedToReconfigureAnApplicationContextOnRefresh() { MockObjectFactoryPostProcessor mofp = new MockObjectFactoryPostProcessor(); IConfigurableApplicationContext ctx = new XmlApplicationContext(false, "name", false, null); ctx.AddObjectFactoryPostProcessor(new DelegateObjectFactoryConfigurer(of => of.RegisterSingleton("mofp", mofp))); ctx.Refresh(); mofp.Called = false; 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(delegate(IConfigurableListableObjectFactory of) { of.RegisterSingleton("mofp", mofp); })); ctx.Refresh(); Assert.IsTrue(mofp.Called); }
public void GlobalSetup() { container = new XmlApplicationContext("ContainerBenchmark.xml"); container.Refresh(); }