Пример #1
0
        public void mustParseInnerMsgOfSecondTag()
        {
            string line = "<node name= \"value\" > inner <br> first </br><br> second </br></node>";
            DOMBuilder builder = new DOMBuilder();
            builder.parseHTMLFile(line);

            Assert.AreEqual(" second ", builder.First.Children[1].InnerMsg);
        }
Пример #2
0
        public void mustParseInnerMsg()
        {
            string line = "<node name= \"value\" > inner </node>";
            DOMBuilder builder = new DOMBuilder();
            builder.parseHTMLFile(line);

            Assert.AreEqual(" inner ", builder.First.InnerMsg);
        }
Пример #3
0
        public void mustParseAttributeValue()
        {
            string line = "<node name=\"value\"></node>";
            DOMBuilder builder = new DOMBuilder();
            builder.parseHTMLFile(line);

            Assert.AreEqual("value", builder.First.Attributes[0].Value);
        }
Пример #4
0
        public void mustParseInnerMsgOfThirdLevelSecondTag()
        {
            string line = "<node name= \"value\" > 1 <br> 2 <br> 2.1 </br><br> 2.2 </br></br></node>";
            DOMBuilder builder = new DOMBuilder();
            builder.parseHTMLFile(line);

            Assert.AreEqual(" 1 ", builder.First.InnerMsg);
            Assert.AreEqual(" 2 ", builder.First.Children[0].InnerMsg);
            Assert.AreEqual(" 2.1 ", builder.First.Children[0].Children[0].InnerMsg);
            Assert.AreEqual(" 2.2 ", builder.First.Children[0].Children[1].InnerMsg);
        }
Пример #5
0
        public void mustParseInnerMsgOfThirdLevelTag()
        {
            string line = "<node name= \"value\" > one <br> two <br> three </br></br></node>";
            DOMBuilder builder = new DOMBuilder();
            builder.parseHTMLFile(line);

            Assert.AreEqual(" one ", builder.First.InnerMsg);
            Assert.AreEqual(" two ", builder.First.Children[0].InnerMsg);
            Assert.AreEqual(" three ", builder.First.Children[0].Children[0].InnerMsg);
        }
Пример #6
0
        public void mustParseNodeName()
        {
            string line = "<name ></name>";
            DOMBuilder builder = new DOMBuilder();
            builder.parseHTMLFile(line);

            Assert.AreEqual("name", builder.First.Name);
        }