Exemplo n.º 1
0
        public void AppendSingleReplacementTagAddsTagForReplacementToTheEndOfTheDocument()
        {
            using (var document = new DocxDocument(Resources.DocumentWithoutParagraph))
            {
                var initialCount = GetParagraphs(document).Count;

                document.AppendSelfclosingTag("Test");

                var paragraphs = GetParagraphs(document);

                Assert.AreEqual("{{Test}}", paragraphs.Last().InnerText);
                Assert.AreEqual(initialCount + 1, paragraphs.Count);
            }
        }
Exemplo n.º 2
0
        public void AppendHiddenSingleReplacementTagAddsTagForReplacementToTheEndOfTheDocument()
        {
            using (var document = new DocxDocument(Resources.DocumentWithoutParagraph))
            {
                var initialCount = GetParagraphs(document).Count;

                document.AppendSelfclosingTag("Test", false);

                var paragraphs = GetParagraphs(document);

                var insertedParagraph = paragraphs.Last();
                Assert.AreEqual("{{Test}}", insertedParagraph.InnerText);
                Assert.IsNotEmpty(insertedParagraph.ParagraphProperties);
                Assert.AreEqual(initialCount + 1, paragraphs.Count);
            }
        }