Exemplo n.º 1
0
        public void NonexistentTagTest()
        {
            ITextExtractor t = new XMLTextExtractor(testString1, nonexistentTag);

            Assert.IsFalse(t.HasNextContent());
            Assert.IsNull(t.FindNextContent());
        }
Exemplo n.º 2
0
        public void TextExtractionTest()
        {
            ITextExtractor t = new XMLTextExtractor(testString1, tag);

            Assert.IsTrue(t.HasNextContent());
            Assert.IsNotNull(t.Tag);

            for (int i = 0; i < 3; i++)
            {
                Assert.IsTrue(t.HasNextContent());
                string post = t.FindNextContent();
                Assert.AreEqual(content[i], post);
            }

            Assert.IsFalse(t.HasNextContent());
            Assert.IsNull(t.FindNextContent());
        }