public void FixOverridedQuotationHistoryTest() { ExchangeSystemSetting setting = new ExchangeSystemSetting(); XmlSerializer serializer = new XmlSerializer(typeof(ManagerSettings)); ManagerSettings settings = (ManagerSettings)serializer.Deserialize(new FileStream(@"D:\Teams\iExchangeCollection\iExchange3 Team\Manager\Manager.UnitTest\bin\Debug\Configuration\Manager.config", FileMode.Open)); setting = settings.ExchangeSystems[0]; QuotationServer target = new QuotationServer(setting); // 初始化为适当的值 Token token = new Token(Guid.Empty, UserType.System, AppType.RiskMonitor); // 初始化为适当的值 string quotation = "<Local><Quotation InstrumentID='1DFB99D4-2B76-48B0-9109-0A67265F5B9F' Timestamp='2013-02-01 04:00:00.000' Origin='1.3559' Status='Modified'/></Local>"; // 初始化为适当的值 bool needApplyAutoAdjustPoints = false; // 初始化为适当的值 iExchange.Common.OriginQuotation[] originQs = null; // 初始化为适当的值 // iExchange.Common.OriginQuotation[] originQsExpected = null; // 初始化为适当的值 iExchange.Common.OverridedQuotation[] overridedQs = null; // 初始化为适当的值 // iExchange.Common.OverridedQuotation[] overridedQsExpected = null; // 初始化为适当的值 bool needBroadcastQuotation = false; // 初始化为适当的值 // bool needBroadcastQuotationExpected = true; // 初始化为适当的值 XmlNode fixChartDatas = null; // 初始化为适当的值 // XmlNode fixChartDatasExpected = null; // 初始化为适当的值 bool expected = true; // 初始化为适当的值 bool actual; actual = target.FixOverridedQuotationHistory(token, quotation, needApplyAutoAdjustPoints, out originQs, out overridedQs, out needBroadcastQuotation, out fixChartDatas); //Assert.AreEqual(originQsExpected, originQs); //Assert.AreEqual(overridedQsExpected, overridedQs); //Assert.AreEqual(needBroadcastQuotationExpected, needBroadcastQuotation); //Assert.AreEqual(fixChartDatasExpected, fixChartDatas); Assert.AreEqual(expected, actual); }
public ExchangeSystem(ExchangeSystemSetting exchangeSystemSetting, ConnectionManager connectionManager) { this._ExchangeSystemSetting = exchangeSystemSetting; this._ConnectionManager = connectionManager; this._CommandRelayEngine = new RelayEngine<Command>(this.DispatchCommand, this.HandleEngineException); this._QuotationRelayEngine = new RelayEngine<List<GeneralQuotation>>(this.SetQuotation, this.HandleQuotationRelayEngineException); this._QuotationServer = new QuotationServer(exchangeSystemSetting); }
public void SetLimit() { ExchangeSystemSetting setting = new ExchangeSystemSetting(); XmlSerializer serializer = new XmlSerializer(typeof(ManagerSettings)); ManagerSettings settings = (ManagerSettings)serializer.Deserialize(new FileStream(@"D:\Teams\iExchangeCollection\iExchange3 Team\Manager\Manager.UnitTest\bin\Debug\Configuration\Manager.config", FileMode.Open)); setting = settings.ExchangeSystems[0]; QuotationServer quotation = new QuotationServer(setting); }
private Thread _Thread = null; //keep running until IIS abort it #endregion Fields #region Constructors public QuotationFileCache(QuotationServer quotationServer, string directoryName, string connectionString) { this._QuotationServer = quotationServer; this._DirectoryName = directoryName; this._QuotationConnectionString = connectionString; if (!Directory.Exists(this._DirectoryName)) { Directory.CreateDirectory(this._DirectoryName); } this.LoadExistingFilesBeforeStart(); }
public void DiscardQuotationTest() { ExchangeSystemSetting setting = null; // 初始化为适当的值 QuotationServer target = new QuotationServer(setting); // 初始化为适当的值 Token token = new Token(Guid.Empty, UserType.System, AppType.RiskMonitor); // 初始化为适当的值 Guid instrumentID = new Guid(); // 初始化为适当的值 iExchange.Common.OriginQuotation[] originQs = null; // 初始化为适当的值 iExchange.Common.OriginQuotation[] originQsExpected = null; // 初始化为适当的值 iExchange.Common.OverridedQuotation[] overridedQs = null; // 初始化为适当的值 iExchange.Common.OverridedQuotation[] overridedQsExpected = null; // 初始化为适当的值 bool expected = false; // 初始化为适当的值 bool actual; actual = target.DiscardQuotation(token, instrumentID, out originQs, out overridedQs); Assert.AreEqual(originQsExpected, originQs); Assert.AreEqual(overridedQsExpected, overridedQs); Assert.AreEqual(expected, actual); }
public void TestMethod1() { ExchangeSystemSetting setting = new ExchangeSystemSetting(); XmlSerializer serializer = new XmlSerializer(typeof(ManagerSettings)); ManagerSettings settings = (ManagerSettings)serializer.Deserialize(new FileStream(@"D:\Teams\iExchangeCollection\iExchange3 Team\Manager\Manager.UnitTest\bin\Debug\Configuration\Manager.config", FileMode.Open)); setting = settings.ExchangeSystems[0]; QuotationServer quotation = new QuotationServer(setting); List<GeneralQuotation> quotations = new List<GeneralQuotation>(); GeneralQuotation gene = new GeneralQuotation(); gene.Ask = 10; gene.Bid = 10; gene.High = 20; gene.Low = 8; gene.Volume = "12"; gene.TotalVolume = "13"; gene.OriginCode = "XAUUSD"; quotations.Add(gene); Token token = new Token(Guid.Empty, UserType.System, AppType.RiskMonitor); iExchange.Common.OriginQuotation[] originQs = null; iExchange.Common.OverridedQuotation[] overridedQs = null; quotation.SetQuotation(token, quotations, out originQs, out overridedQs); }
/// <summary> /// /// </summary> /// <param name="directoryName">direcotry to writing quotation files</param> /// <param name="connectionString">database connection string</param> /// <param name="batchSize">how many OriginQuotations contains in one BulkCopy</param> public QuotationFileCache(QuotationServer quotationServer, string directoryName, string connectionString, int batchSize, TimeSpan commitFrequency) : this(quotationServer, directoryName, connectionString) { this._BatchSize = batchSize; this._CommitFrequency = commitFrequency; }
public void UpdateTest() { ExchangeSystemSetting setting = null; // 初始化为适当的值 QuotationServer target = new QuotationServer(setting); // 初始化为适当的值 Token token = new Token(Guid.Empty, UserType.System, AppType.RiskMonitor); // 初始化为适当的值 XmlNode update = null; // 初始化为适当的值 bool expected = false; // 初始化为适当的值 bool actual; actual = target.Update(token, update); Assert.AreEqual(expected, actual); }
public void GetQuotationTest() { ExchangeSystemSetting setting = new ExchangeSystemSetting(); XmlSerializer serializer = new XmlSerializer(typeof(ManagerSettings)); ManagerSettings settings = (ManagerSettings)serializer.Deserialize(new FileStream(@"D:\Teams\iExchangeCollection\iExchange3 Team\Manager\Manager.UnitTest\bin\Debug\Configuration\Manager.config", FileMode.Open)); setting = settings.ExchangeSystems[0]; // 初始化为适当的值 QuotationServer target = new QuotationServer(setting); // 初始化为适当的值 Token token = new Token(Guid.Empty, UserType.System, AppType.RiskMonitor); // 初始化为适当的值 string expected = string.Empty; // 初始化为适当的值 string actual; actual = target.GetQuotation(token); Assert.AreEqual(expected, actual); }
public void UpdateOverridedQuotationHighLowTest() { ExchangeSystemSetting setting = null; // 初始化为适当的值 QuotationServer target = new QuotationServer(setting); // 初始化为适当的值 Token token = new Token(Guid.Empty, UserType.System, AppType.RiskMonitor); // 初始化为适当的值 Guid instrumentID = new Guid(); // 初始化为适当的值 string quotation = string.Empty; // 初始化为适当的值 iExchange.Common.OverridedQuotation[] overridedQs = null; // 初始化为适当的值 iExchange.Common.OverridedQuotation[] overridedQsExpected = null; // 初始化为适当的值 bool expected = false; // 初始化为适当的值 bool actual; actual = target.UpdateOverridedQuotationHighLow(token, instrumentID, quotation, out overridedQs); Assert.AreEqual(overridedQsExpected, overridedQs); Assert.AreEqual(expected, actual); }
public void UpdateInstrumentDealerTest() { ExchangeSystemSetting setting = null; // 初始化为适当的值 QuotationServer target = new QuotationServer(setting); // 初始化为适当的值 Token token = new Token(Guid.Empty, UserType.System, AppType.RiskMonitor); // 初始化为适当的值 DataSet instrumentSettingChanges = null; // 初始化为适当的值 target.UpdateInstrumentDealer(token, instrumentSettingChanges); }
public void UpdateHighLowTest() { ExchangeSystemSetting setting = null; // 初始化为适当的值 QuotationServer target = new QuotationServer(setting); // 初始化为适当的值 Token token = new Token(Guid.Empty, UserType.System, AppType.RiskMonitor); // 初始化为适当的值 string ip = string.Empty; // 初始化为适当的值 Guid instrumentId = new Guid(); // 初始化为适当的值 bool isOriginHiLo = false; // 初始化为适当的值 string newInput = string.Empty; // 初始化为适当的值 bool isUpdateHigh = false; // 初始化为适当的值 int batchProcessId = 0; // 初始化为适当的值 int batchProcessIdExpected = 0; // 初始化为适当的值 string instrumentCode = string.Empty; // 初始化为适当的值 string instrumentCodeExpected = string.Empty; // 初始化为适当的值 bool highBid = false; // 初始化为适当的值 bool highBidExpected = false; // 初始化为适当的值 bool lowBid = false; // 初始化为适当的值 bool lowBidExpected = false; // 初始化为适当的值 DateTime updateTime = new DateTime(); // 初始化为适当的值 DateTime updateTimeExpected = new DateTime(); // 初始化为适当的值 DateTime minTimestamp = new DateTime(); // 初始化为适当的值 DateTime minTimestampExpected = new DateTime(); // 初始化为适当的值 iExchange.Common.OverridedQuotation[] overridedQs = null; // 初始化为适当的值 iExchange.Common.OverridedQuotation[] overridedQsExpected = null; // 初始化为适当的值 int returnValue = 0; // 初始化为适当的值 int returnValueExpected = 0; // 初始化为适当的值 string errorMessage = string.Empty; // 初始化为适当的值 string errorMessageExpected = string.Empty; // 初始化为适当的值 target.UpdateHighLow(token, ip, instrumentId, isOriginHiLo, newInput, isUpdateHigh, out batchProcessId, out instrumentCode, out highBid, out lowBid, out updateTime, out minTimestamp, out overridedQs, out returnValue, out errorMessage); Assert.AreEqual(batchProcessIdExpected, batchProcessId); Assert.AreEqual(instrumentCodeExpected, instrumentCode); Assert.AreEqual(highBidExpected, highBid); Assert.AreEqual(lowBidExpected, lowBid); Assert.AreEqual(updateTimeExpected, updateTime); Assert.AreEqual(minTimestampExpected, minTimestamp); Assert.AreEqual(overridedQsExpected, overridedQs); Assert.AreEqual(returnValueExpected, returnValue); Assert.AreEqual(errorMessageExpected, errorMessage); }
public void SetQuotationTest() { ExchangeSystemSetting setting = new ExchangeSystemSetting(); XmlSerializer serializer = new XmlSerializer(typeof(ManagerSettings)); ManagerSettings settings = (ManagerSettings)serializer.Deserialize(new FileStream(@"D:\Teams\iExchangeCollection\iExchange3 Team\Manager\Manager.UnitTest\bin\Debug\Configuration\Manager.config", FileMode.Open)); setting = settings.ExchangeSystems[0]; // 初始化为适当的值 QuotationServer target = new QuotationServer(setting); // 初始化为适当的值 Token token = new Token(Guid.Empty, UserType.System, AppType.QuotationCollector); // 初始化为适当的值 List<GeneralQuotation> quotations = new List<GeneralQuotation>(); // 初始化为适当的值 GeneralQuotation gene = new GeneralQuotation(); gene.Ask = 10; gene.Bid = 10; gene.High = 20; gene.Low = 8; gene.Volume = "12"; gene.TotalVolume = "13"; gene.OriginCode = "XAUUSD"; quotations.Add(gene); iExchange.Common.OriginQuotation[] originQs = null; // 初始化为适当的值 //iExchange.Common.OriginQuotation[] originQsExpected = null; // 初始化为适当的值 iExchange.Common.OverridedQuotation[] overridedQs = null; // 初始化为适当的值 //iExchange.Common.OverridedQuotation[] overridedQsExpected = null; // 初始化为适当的值 bool expected = true; // 初始化为适当的值 bool actual; actual = target.SetQuotation(token, quotations, out originQs, out overridedQs); //Assert.AreEqual(originQsExpected, originQs); //Assert.AreEqual(overridedQsExpected, overridedQs); Assert.AreEqual(expected, actual); }
public void ResetTest() { ExchangeSystemSetting setting = null; // 初始化为适当的值 QuotationServer target = new QuotationServer(setting); // 初始化为适当的值 target.Reset(); }
public void ReplayQuotationTest() { ExchangeSystemSetting setting = new ExchangeSystemSetting(); XmlSerializer serializer = new XmlSerializer(typeof(ManagerSettings)); ManagerSettings settings = (ManagerSettings)serializer.Deserialize(new FileStream(@"D:\Teams\iExchangeCollection\iExchange3 Team\Manager\Manager.UnitTest\bin\Debug\Configuration\Manager.config", FileMode.Open)); setting = settings.ExchangeSystems[0]; // 初始化为适当的值 QuotationServer target = new QuotationServer(setting); // 初始化为适当的值 Token token = new Token(Guid.Empty, UserType.System, AppType.RiskMonitor); // 初始化为适当的值 List<GeneralQuotation> quotations = null; // 初始化为适当的值 iExchange.Common.OriginQuotation[] originQs = null; // 初始化为适当的值 // iExchange.Common.OriginQuotation[] originQsExpected = null; // 初始化为适当的值 iExchange.Common.OverridedQuotation[] overridedQs = null; // 初始化为适当的值 // iExchange.Common.OverridedQuotation[] overridedQsExpected = null; // 初始化为适当的值 bool expected = false; // 初始化为适当的值 bool actual; actual = target.ReplayQuotation(token, quotations, out originQs, out overridedQs); //Assert.AreEqual(originQsExpected, originQs); //Assert.AreEqual(overridedQsExpected, overridedQs); Assert.AreEqual(expected, actual); }
public void QuotationServerConstructorTest() { ExchangeSystemSetting setting = null; // 初始化为适当的值 QuotationServer target = new QuotationServer(setting); }
public void UpdateQuotePolicyTest() { ExchangeSystemSetting setting = null; // 初始化为适当的值 QuotationServer target = new QuotationServer(setting); // 初始化为适当的值 Token token = new Token(Guid.Empty, UserType.System, AppType.RiskMonitor); // 初始化为适当的值 XmlNode quotePolicy = null; // 初始化为适当的值 int error = 0; // 初始化为适当的值 int errorExpected = 0; // 初始化为适当的值 bool expected = false; // 初始化为适当的值 bool actual; actual = target.UpdateQuotePolicy(token, quotePolicy, out error); Assert.AreEqual(errorExpected, error); Assert.AreEqual(expected, actual); }
public void FlushTest() { ExchangeSystemSetting setting = new ExchangeSystemSetting(); XmlSerializer serializer = new XmlSerializer(typeof(ManagerSettings)); ManagerSettings settings = (ManagerSettings)serializer.Deserialize(new FileStream(@"D:\Teams\iExchangeCollection\iExchange3 Team\Manager\Manager.UnitTest\bin\Debug\Configuration\Manager.config", FileMode.Open)); setting = settings.ExchangeSystems[0]; // 初始化为适当的值 QuotationServer target = new QuotationServer(setting); // 初始化为适当的值 bool expected = true; // 初始化为适当的值 bool actual; actual = target.Flush(); Assert.AreEqual(expected, actual); }