Esempio n. 1
0
        public void InsertVerseNumber_AfterChapterNumber()
        {
            // Remove the formatting on the verse number so it doesn't interfere with the test.
            m_draftView.SelectRangeOfChars(1, 11, 0, 1, 2);
            m_draftView.EditingHelper.RemoveCharFormatting();
            // Set the IP right after the chapter number in James 4:1
            m_draftView.SetInsertionPoint(1, 11, 0, 1, true);
            // insert verse num 1 at the IP
            m_draftView.InsertVerseNumber();
            IScrBook book =
                Cache.LangProject.TranslatedScriptureOA.ScriptureBooksOS[1];
            IStTxtPara para =
                (IStTxtPara)book.SectionsOS[11].ContentOA.ParagraphsOS[0];
            ITsString tss = para.Contents;

            Assert.AreEqual(15, tss.RunCount);
            AssertEx.RunIsCorrect(tss, 0, "4", "Chapter Number", Cache.DefaultVernWs);
            AssertEx.RunIsCorrect(tss, 1, "1", "Verse Number", Cache.DefaultVernWs);
            Assert.AreEqual("1Where do all the fights",
                            para.Contents.get_RunText(2).Substring(0, 24));
            Assert.AreEqual(StyleUtils.CharStyleTextProps(null, Cache.DefaultVernWs),
                            para.Contents.get_Properties(2));
        }