public void DceHolidayContractDealerPositionParserTest() { DateTime date = new DateTime(2015, 1, 1); string webText = TestUtility.RetrieveWebPage(date, new DceDealerPositionCrawler("a", "1409")); var parser = new DceDealerPositionParser(); var listFromWeb = parser.GetDealerPositionList(webText, date); Assert.IsTrue(listFromWeb.Count == 0); }
public void DceContractDealerPositionParserTest() { DateTime date = new DateTime(2014, 1, 6); string webText = TestUtility.RetrieveWebPage(date, new DceDealerPositionCrawler("a", "1409")); var parser = new DceDealerPositionParser(); var listFromWeb = parser.GetDealerPositionList(webText, date); var testData = new List <SingleDealerPosition>(); testData.Add(new SingleDealerPosition(date, "a", "1409", InformationType.VolumeInfo, 1, "国投期货", 1649)); testData.Add(new SingleDealerPosition(date, "a", "1409", InformationType.SellInfo, 121, "中信新际", 0)); testData.Add(new SingleDealerPosition(date, "a", "1409", InformationType.BuyInfo, 120, "先融期货", 0)); testData.Add(new SingleDealerPosition(date, "a", "1409", InformationType.VolumeInfo, 123, "天富期货", 1)); testData.Add(new SingleDealerPosition(date, "a", "1409", InformationType.BuyInfo, 10, "新湖期货", 1075)); ValidateValues(testData, listFromWeb); }
public void DceCommodityDealerPositionParserTest() { DateTime date = new DateTime(2014, 1, 6); string webText = TestUtility.RetrieveWebPage(date, new DceDealerPositionCrawler("a", "")); var parser = new DceDealerPositionParser(); var listFromWeb = parser.GetDealerPositionList(webText, date); var testData = new List <SingleDealerPosition>(); testData.Add(new SingleDealerPosition(date, "a", "", InformationType.VolumeInfo, 1, "国投期货", 5167)); testData.Add(new SingleDealerPosition(date, "a", "", InformationType.SellInfo, 145, "京都期货", 0)); testData.Add(new SingleDealerPosition(date, "a", "", InformationType.BuyInfo, 141, "深圳金汇", 0)); testData.Add(new SingleDealerPosition(date, "a", "", InformationType.VolumeInfo, 145, "平安期货", 2)); testData.Add(new SingleDealerPosition(date, "a", "", InformationType.BuyInfo, 25, "南华期货", 1024)); ValidateValues(testData, listFromWeb); }