Exemplo n.º 1
0
        public void Clone()
        {
            var format = new PathSingleValueFormat("Ariva.Symbol");

            format.Path        = @"/BODY[0]/DIV[4]/DIV[0]/DIV[3]/DIV[2]";
            format.ValueFormat = new ValueFormat(typeof(int), "00000000", new Regex(@"Symbol: (\W+)"));

            var clone = (PathSingleValueFormat)format.Clone();

            Assert.AreEqual(format.Name, clone.Name);
            Assert.AreEqual(format.Path, clone.Path);
            Assert.AreEqual(format.ValueFormat, format.ValueFormat);
        }
Exemplo n.º 2
0
        public void WpknFromAriva()
        {
            var inputFile = OS.CombinePaths(TestDataRoot, "Recognition", "Core", "ariva.overview.US0138171014.html");
            var doc       = myWebScrapSC.GetDocument(new Navigation(DocumentType.Html, inputFile));

            var format = new PathSingleValueFormat("Ariva.Wpkn");

            format.Path        = @"/BODY[0]/DIV[4]/DIV[0]/DIV[3]/DIV[0]";
            format.ValueFormat = new ValueFormat(typeof(int), "00000000", new Regex(@"WKN: (\d+)"));

            var table = doc.ExtractTable(format);

            Assert.AreEqual(1, table.Rows.Count);

            Assert.AreEqual(850206, table.Rows[0][0]);
        }