示例#1
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        /// Creates a book (Exodus) with 3 sections with the following layout:
        ///
        ///			(Exodus)
        ///		   Heading 1
        ///	Intro text
        ///		   Heading 2
        ///	(1)1Verse one. 2Verse two.
        ///	3Verse three.
        ///	4Verse four. 5Verse five.
        ///		   Heading 3
        ///	6Verse six. 7Verse seven.
        ///
        ///	(1) = chapter number 1
        /// </summary>
        /// <returns>the book of Exodus for testing</returns>
        /// ------------------------------------------------------------------------------------
        protected IScrBook CreateExodusData()
        {
            IScrBook book = m_scrInMemoryCache.AddBookToMockedScripture(2, "Exodus");

            m_scrInMemoryCache.AddTitleToMockedBook(book.Hvo, "Exodus");

            IScrSection section1 = m_scrInMemoryCache.AddIntroSectionToMockedBook(book.Hvo);

            m_scrInMemoryCache.AddSectionHeadParaToSection(section1.Hvo, "Heading 1", ScrStyleNames.IntroSectionHead);
            StTxtPara para11 = m_scrInMemoryCache.AddParaToMockedSectionContent(section1.Hvo, ScrStyleNames.IntroParagraph);

            m_scrInMemoryCache.AddRunToMockedPara(para11, "Intro text. We need lots of stuff here so that our footnote tests will work.", null);
            section1.AdjustReferences();

            IScrSection section2 = m_scrInMemoryCache.AddSectionToMockedBook(book.Hvo);

            m_scrInMemoryCache.AddSectionHeadParaToSection(section2.Hvo, "Heading 2", ScrStyleNames.SectionHead);
            StTxtPara para21 = m_scrInMemoryCache.AddParaToMockedSectionContent(section2.Hvo, ScrStyleNames.NormalParagraph);

            m_scrInMemoryCache.AddRunToMockedPara(para21, "1", ScrStyleNames.ChapterNumber);
            m_scrInMemoryCache.AddRunToMockedPara(para21, "1", ScrStyleNames.VerseNumber);
            m_scrInMemoryCache.AddRunToMockedPara(para21, "Verse one. ", null);
            m_scrInMemoryCache.AddRunToMockedPara(para21, "2", ScrStyleNames.VerseNumber);
            m_scrInMemoryCache.AddRunToMockedPara(para21, "Verse two.", null);

            StTxtPara para22 = m_scrInMemoryCache.AddParaToMockedSectionContent(section2.Hvo, ScrStyleNames.NormalParagraph);

            m_scrInMemoryCache.AddRunToMockedPara(para22, "3", ScrStyleNames.VerseNumber);
            m_scrInMemoryCache.AddRunToMockedPara(para22, "Verse three.", null);

            StTxtPara para23 = m_scrInMemoryCache.AddParaToMockedSectionContent(section2.Hvo, ScrStyleNames.NormalParagraph);

            m_scrInMemoryCache.AddRunToMockedPara(para23, "4", ScrStyleNames.VerseNumber);
            m_scrInMemoryCache.AddRunToMockedPara(para23, "Verse four. ", null);
            m_scrInMemoryCache.AddRunToMockedPara(para23, "5", ScrStyleNames.VerseNumber);
            m_scrInMemoryCache.AddRunToMockedPara(para23, "Verse five.", null);
            section2.AdjustReferences();

            IScrSection section3 = m_scrInMemoryCache.AddSectionToMockedBook(book.Hvo);

            m_scrInMemoryCache.AddSectionHeadParaToSection(section3.Hvo, "Heading 3", ScrStyleNames.SectionHead);
            StTxtPara para31 = m_scrInMemoryCache.AddParaToMockedSectionContent(section3.Hvo, ScrStyleNames.NormalParagraph);

            m_scrInMemoryCache.AddRunToMockedPara(para31, "6", ScrStyleNames.VerseNumber);
            m_scrInMemoryCache.AddRunToMockedPara(para31, "Verse six. ", null);
            m_scrInMemoryCache.AddRunToMockedPara(para31, "7", ScrStyleNames.VerseNumber);
            m_scrInMemoryCache.AddRunToMockedPara(para31, "Verse seven.", null);
            section3.AdjustReferences();

            return(book);
        }