Example #1
0
        public void TryGetXmlEntity_ValidXmlEntity_ReturnsSameEntity(string name)
        {
            var m = new HtmlEntityMap();
            var ent = "&" + name + ";";
            var xml = m.TryGetXmlEntity(ent);

            Assert.That(xml, Is.EqualTo(ent));
        }
Example #2
0
        public void TryDecodeEntityString_ValidHtmlEntity(string name, int value)
        {
            var m = new HtmlEntityMap();

            var ent = "&" + name + ";";
            var exp = "&#" + value + ";";

            var xml = m.TryDecodeEntityString(ent);

            Assert.That(xml, Is.Not.Null);
        }
Example #3
0
        public void TryGetXmlEntity_ValidHtmlEntity(string name, int value)
        {
            var m = new HtmlEntityMap();

            var ent = "&" + name + ";";
            var exp = "&#" + value + ";";

            var xml = m.TryGetXmlEntity(ent);

            Assert.That(xml, Is.EqualTo(exp));
        }
Example #4
0
 public ParserImpl(HtmlEntityMap entityMap)
 {
     _entityMap = entityMap;
 }
Example #5
0
 public HtmlParser(bool ignoreEmptyRootTextNodes = false)
 {
     _ignoreEmptyRootTextNodes = ignoreEmptyRootTextNodes;
     _entityMap = new HtmlEntityMap();
 }