예제 #1
0
        public void GetFootnotes_NoFootnotes()
        {
            CheckDisposed();
            ScrSection section1 = (ScrSection)m_philemon.SectionsOS[0];
            StTxtPara  para     = (StTxtPara)section1.ContentOA.ParagraphsOS[0];
            StFootnote footnote = InsertTestFootnote(m_philemon, para, 1, 0);

            m_inMemoryCache.AddParaToMockedText(footnote.Hvo, "Anything");

            ScrSection section2 = (ScrSection)m_philemon.SectionsOS[1];

            para = (StTxtPara)section2.ContentOA.ParagraphsOS[0];

            List <FootnoteInfo> footnotes = section2.GetFootnotes();

            Assert.AreEqual(0, footnotes.Count);
        }
예제 #2
0
        public void GetFootnotes_InHeadingAndContents()
        {
            CheckDisposed();

            ScrSection section1 = (ScrSection)m_philemon.SectionsOS[0];
            StTxtPara  para     = (StTxtPara)section1.HeadingOA.ParagraphsOS[0];
            StFootnote footnote = InsertTestFootnote(m_philemon, para, 0, 0);

            m_inMemoryCache.AddParaToMockedText(footnote.Hvo, "heading footnote");

            para     = (StTxtPara)section1.ContentOA.ParagraphsOS[0];
            footnote = InsertTestFootnote(m_philemon, para, 1, 0);
            m_inMemoryCache.AddParaToMockedText(footnote.Hvo, "Anything");
            footnote = InsertTestFootnote(m_philemon, para, 2, 5);
            m_inMemoryCache.AddParaToMockedText(footnote.Hvo, "Bla");
            footnote = InsertTestFootnote(m_philemon, para, 3, 10);
            m_inMemoryCache.AddParaToMockedText(footnote.Hvo, "hing");

            ScrSection section2 = (ScrSection)m_philemon.SectionsOS[1];

            para     = (StTxtPara)section2.ContentOA.ParagraphsOS[0];
            footnote = InsertTestFootnote(m_philemon, para, 4, 0);
            m_inMemoryCache.AddParaToMockedText(footnote.Hvo, "This one shouldn't be included");

            List <FootnoteInfo> footnotes = section1.GetFootnotes();

            Assert.AreEqual(4, footnotes.Count);
            Assert.AreEqual(m_philemon.FootnotesOS[0].Hvo, ((FootnoteInfo)footnotes[0]).footnote.Hvo);
            Assert.AreEqual("heading footnote", ((FootnoteInfo)footnotes[0]).paraStylename);
            Assert.AreEqual(m_philemon.FootnotesOS[1].Hvo, ((FootnoteInfo)footnotes[1]).footnote.Hvo);
            Assert.AreEqual("Anything", ((FootnoteInfo)footnotes[1]).paraStylename);
            Assert.AreEqual(m_philemon.FootnotesOS[2].Hvo, ((FootnoteInfo)footnotes[2]).footnote.Hvo);
            Assert.AreEqual("Bla", ((FootnoteInfo)footnotes[2]).paraStylename);
            Assert.AreEqual(m_philemon.FootnotesOS[3].Hvo, ((FootnoteInfo)footnotes[3]).footnote.Hvo);
            Assert.AreEqual("hing", ((FootnoteInfo)footnotes[3]).paraStylename);
        }