예제 #1
0
        public void NoUserPromptForContentPara()
        {
            CheckDisposed();

            // Set up empty content paragraph
            IScrSection section = m_inMemoryCache.AddSectionToMockedBook(m_book.Hvo);
            StTxtPara   para    = m_inMemoryCache.AddParaToMockedSectionContent(section.Hvo,
                                                                                ScrStyleNames.NormalParagraph);

            section.AdjustReferences();

            m_vwenvMock.ExpectNoCall("NoteDependency", new string[] { typeof(int[]).FullName,
                                                                      typeof(int[]).FullName, typeInt });
            m_vwenvMock.ExpectNoCall("AddProp", new string[] { typeInt,
                                                               typeof(IVwViewConstructor).FullName, typeInt });

            DummyTeStVc stVc       = new DummyTeStVc(m_inMemoryCache.Cache, m_inMemoryCache.Cache.DefaultVernWs);
            bool        fTextAdded = stVc.CallInsertUserPrompt((IVwEnv)m_vwenvMock.MockInstance,
                                                               para.Hvo);

            Assert.IsFalse(fTextAdded, "User prompt was added to empty content para");
            m_vwenvMock.Verify();
        }
예제 #2
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        /// Creates a new paragraph
        /// </summary>
        /// <param name="sectionHvo">The hvo of the section to which the paragraph will be
        /// added</param>
        /// <param name="chapterNumber">the chapter number to create or <c>null</c> if no
        /// chapter number is desired.</param>
        /// <param name="verseNumber">the chapter number to create or <c>null</c> if no
        /// verse number is desired.</param>
        /// <returns>The newly created paragraph.</returns>
        /// ------------------------------------------------------------------------------------
        protected StTxtPara SetupParagraph(int sectionHvo, string chapterNumber, string verseNumber)
        {
            StTxtPara para = m_scrInMemoryCache.AddParaToMockedSectionContent(sectionHvo, "Paragraph");

            if (chapterNumber != null)
            {
                m_scrInMemoryCache.AddRunToMockedPara(para, chapterNumber, "Chapter Number");
            }
            if (verseNumber != null)
            {
                m_scrInMemoryCache.AddRunToMockedPara(para, verseNumber, "Verse Number");
            }
            m_scrInMemoryCache.AddRunToMockedPara(para, kParagraphText, null);

            return(para);
        }