public void TestRegisterDataCenter() { string path = TestCaseManager.GetTestCasePath(GetType(), "output_RegisterDataCenter.config"); try { DataCenterManager mgr = DataCenterManager.Create(path); string uri = "file:/e:/futures/mockdatacenter/"; string id = "d1"; DataCenterInfo config = GetDataCenterInfo(uri, id); mgr.RegisterDataCenter(config); Assert.AreEqual(1, mgr.GetAllConfig().Count); DataCenter dataCenter = mgr.GetDataCenterByUri(uri); Assert.AreEqual(uri, dataCenter.Config.Uri); string uri2 = "file:/d:/scdata/cnfutures/"; string id2 = "d2"; config = GetDataCenterInfo(uri2, id2); mgr.RegisterDataCenter(config); Assert.AreEqual(2, mgr.GetAllConfig().Count); mgr.UnRegisterDataCenter(uri); dataCenter = mgr.GetDataCenterByUri(uri); Assert.IsNull(dataCenter); Assert.AreEqual(1, mgr.GetAllConfig().Count); } finally { File.Delete(path); } }
public void TestCreateDataCenter2() { string path = TestCaseManager.GetTestCasePath(GetType(), "datacenter.config"); DataCenterManager mgr = DataCenterManager.Create(path); string uri = "file:/e:/FUTURES/MOCKDATACENTER/"; DataCenter dataCenter = mgr.GetDataCenterByUri(uri); Assert.AreEqual(uri, dataCenter.Config.Uri); }