public void testAutowired() { InitManually(GetType()); Bean1 bean1 = BeanContext.GetService <Bean1>(bean1Name); Assert.AssertNull(bean1.bean2); Assert.AssertNotNull(bean1.bean2Autowired); Assert.AssertNull(bean1.bean3); Assert.AssertNull(bean1.bean3Autowired); }
public void testAutowiredByName() { IServiceContext beanContext = this.BeanContext.CreateService(typeof(AutowiredTestModule4)); try { Bean1 bean1 = beanContext.GetService <Bean1>(bean1Name); Assert.AssertNull(bean1.bean2); Assert.AssertNotNull(bean1.bean2Autowired); Assert.AssertNull(bean1.bean3); Assert.AssertNull(bean1.bean3Autowired); } finally { beanContext.Dispose(); } }