public void Test3_DataVerification() { ParkietExtractor extractor = new ParkietExtractor(SourcetHtml); extractor.TrimInputBetween(new [] { "<div class=\"quotations\">", "<tbody>" }, "</tbody>"); extractor.RemoveEvery("abc"); List<Company> companies = extractor.GetCompanies(); Assert.IsTrue(companies.Count == 4); // Company c = companies[2]; Assert.IsTrue(c.ID == "06N"); Assert.IsTrue(c.Name == "06MAGNA"); Assert.IsTrue(c.PaperCode == "PLNFI0600010"); }
public void Test2_ExtractionIsCorrect() { ParkietExtractor extractor = new ParkietExtractor(SourcetHtml); extractor.TrimInputBetween(new string[] { "<div class=\"quotations\">", "<tbody>" }, new string[] { "</tbody>", "</table>" }); //check beginning int idx = extractor.InputHtml.IndexOf("abc"); Assert.IsTrue(idx == 0); //check ending idx = extractor.InputHtml.IndexOf("</table>"); int textLength = extractor.InputHtml.Length - 8; Assert.IsTrue(idx == textLength); }