Ejemplo n.º 1
0
        public void ShfeHolidayDealerPositionParserTest()
        {
            DateTime date        = new DateTime(2015, 1, 1);
            string   webText     = TestUtility.RetrieveWebPage(date, new ShfeDealerPositionCrawler());
            var      parser      = new ShfeDealerPositionParser();
            var      listFromWeb = parser.GetDealerPositionList(webText, date);

            Assert.IsTrue(listFromWeb.Count == 0);
        }
Ejemplo n.º 2
0
        public void ShfeDealerPositionParserTest()
        {
            DateTime date        = new DateTime(2014, 1, 6);
            string   webText     = TestUtility.RetrieveWebPage(date, new ShfeDealerPositionCrawler());
            var      parser      = new ShfeDealerPositionParser();
            var      listFromWeb = parser.GetDealerPositionList(webText, date);

            var testData = new List <SingleDealerPosition>();

            testData.Add(new SingleDealerPosition(date, "cu", "1403", InformationType.VolumeInfo, 1, "中证期货", 14654));
            testData.Add(new SingleDealerPosition(date, "cu", "1403", InformationType.SellInfo, 20, "光大期货", 1337));
            testData.Add(new SingleDealerPosition(date, "zn", "1401", InformationType.SellInfo, 13, "经易期货", 10));
            testData.Add(new SingleDealerPosition(date, "au", "1401", InformationType.BuyInfo, 10, "中原期货", 3));
            testData.Add(new SingleDealerPosition(date, "ru", "1409", InformationType.SellInfo, 20, "财富期货", 500));

            ValidateValues(testData, listFromWeb);
        }