public void Scan() { CreateParser("<html>" + " <head>"+ " <title>Some Title</title>"+ " </head>"+ " <body>" + " Some data"+ " </body>"+ "</html>"); parser.AddScanner(new TitleScanner("")); parser.AddScanner(new HtmlScanner()); ParseAndAssertNodeCount(1); AssertType("html tag", typeof(Html), this.node[0]); Html html = (Html)this.node[0]; NodeList nodeList = new NodeList(); html.CollectInto(nodeList, typeof(TitleTag)); Assert.AreEqual(1, nodeList.Size, "nodelist size"); Node node = nodeList[0]; AssertType("expected title tag", typeof(TitleTag), node); TitleTag titleTag = (TitleTag)node; AssertStringEquals("title", "Some Title", titleTag.Title); }
public override void VisitTitleTag(TitleTag titleTag) { textAccumulator.Append(titleTag.Title); }
public virtual void VisitTitleTag(TitleTag titleTag) { }