Exemplo n.º 1
0
        public void CheckHtmlTagsAfterBodyUntilEndTest()
        {
            string textGood1 = "<html><head><title> Some title </title></head><body> Some body < /body>  <  /html>";
            string textGood2 = "<html><head><title></title></head><body></body></html>";
            string textBad1  = "";
            string textBad2  = "<html><head><title";
            string textBad3  = "<html>head><title> Some title ";
            string textBad4  = "<html><head><title> Some title </title></head><body";
            string textBad5  = "<html><head><title> Some title </title></head><body> Some body ";
            string textBad6  = "<html><head><title> Some title </title></head><body> Some body </body>";

            Parser.Parser p = new Parser.Parser();

            Assert.AreEqual(true, p.CheckHtmlTagsAfterBodyUntilEnd(textGood1));
            Assert.AreEqual(true, p.CheckHtmlTagsAfterBodyUntilEnd(textGood2));
            Assert.AreEqual(false, p.CheckHtmlTagsAfterBodyUntilEnd(textBad1));
            Assert.AreEqual(false, p.CheckHtmlTagsAfterBodyUntilEnd(textBad2));
            Assert.AreEqual(false, p.CheckHtmlTagsAfterBodyUntilEnd(textBad3));
            Assert.AreEqual(false, p.CheckHtmlTagsAfterBodyUntilEnd(textBad4));
            Assert.AreEqual(false, p.CheckHtmlTagsAfterBodyUntilEnd(textBad5));
            Assert.AreEqual(false, p.CheckHtmlTagsAfterBodyUntilEnd(textBad6));
        }