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);
 }
Exemplo n.º 2
0
 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);
 }
Exemplo n.º 3
0
 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);
 }
 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 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 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 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);
 }