public void Castle() { SystemConfig.ConfigFilesAssemblyName = "CodeSharp.Framework.Castles.Test"; SystemConfig.Configure("ConfigFiles") .Castle() .BusinessDependency(Assembly.GetExecutingAssembly()); Assert.AreEqual("abc", SystemConfig.Settings["key1"]); Assert.DoesNotThrow(() => DependencyResolver.Resolve <ILoggerFactory>().Create(this.GetType()).Info("hi")); Assert.DoesNotThrow(() => DependencyResolver.Resolve <ITestService>()); Assert.DoesNotThrow(() => DependencyResolver.Resolve <NHibernate.ISessionFactory>()); //NH Tests var e = new TestEntity("abc"); var s = DependencyResolver.Resolve <ITestService>(); s.Create(e); DependencyResolver.Resolve <Castle.Facilities.NHibernateIntegration.ISessionManager>().OpenSession().Evict(e); var e2 = s.Get(e.ID); //private setter? Assert.AreEqual(e.Name, e2.Name); Assert.AreEqual("abc", e2.Name); Assert.DoesNotThrow(() => SystemConfig.Cleanup()); }
public override void Unload() { //停止调度 DependencyResolver.Resolve <Taobao.Workflow.Activities.Hosting.IScheduler>().Stop(); SystemConfig.Cleanup(); }
public override void Unload() { SystemConfig.Cleanup(); }