Пример #1
0
        public void TestAppendText()
        {
            const string h1 = "T1 Überschrift 1";
            const string h2 = "Ende T2";

            var masterText = new StructuredText();

            masterText.AddHeader1(h1);
            masterText.AddParagraph(MassText);
            masterText.AddHeader1("Überschrift 2");
            masterText.AddParagraph(MassText);

            masterText.AddCode(MassText);

            masterText.AddParagraph(MassText);
            masterText.AddHeader1("Überschrift 2");
            masterText.AddParagraph(MassText);
            masterText.AddHeader1("Überschrift 1");
            masterText.AddParagraph(MassText);
            masterText.AddParagraph(MassText);
            masterText.AddParagraph(MassText);
            masterText.AddHeader1("Überschrift 2");
            masterText.AddParagraph(MassText);
            masterText.AddParagraph(MassText);
            masterText.AddParagraph(MassText);
            masterText.AddParagraph(MassText);
            masterText.AddHeader1("Überschrift 2");
            masterText.AddParagraph(MassText);
            masterText.AddHeader1("Überschrift 1");
            masterText.AddParagraph(MassText);
            masterText.AddParagraph(MassText);


            var toAppendText = new StructuredText();

            toAppendText.AddHeader1("T2 Überschrift 1");
            toAppendText.AddParagraph(MassText);
            toAppendText.AddHeader1("Überschrift 2");
            toAppendText.AddParagraph(MassText);
            toAppendText.AddParagraph(MassText);
            toAppendText.AddHeader1("Überschrift 2");
            toAppendText.AddParagraph(MassText);
            toAppendText.AddHeader1("Überschrift 1");
            toAppendText.AddParagraph(MassText);
            toAppendText.AddParagraph(MassText);
            toAppendText.AddParagraph(MassText);
            toAppendText.AddHeader1("Überschrift 2");
            toAppendText.AddParagraph(MassText);
            toAppendText.AddParagraph(MassText);
            toAppendText.AddParagraph(MassText);
            toAppendText.AddParagraph(MassText);
            toAppendText.AddHeader1("Überschrift 2");
            toAppendText.AddParagraph(MassText);
            toAppendText.AddHeader1("Überschrift 1");
            toAppendText.AddParagraph(MassText);
            toAppendText.AddParagraph(h2);


            var masterCount   = masterText.TextItems.Count;
            var toAppendCount = toAppendText.TextItems.Count;

            masterText.AppendText(toAppendText);

            Assert.IsTrue(masterText.TextItems.Count == masterCount + toAppendCount);
            Assert.IsTrue(masterText.TextItems[0].Content == h1);
            Assert.IsTrue(masterText.TextItems[masterText.TextItems.Count - 1].Content == h2);
        }