public void Parse_TitleNotFollowedByChapter_TitleIsSimplified()
        {
            var doc = UsxDocumentTests.CreateDocFromString(
                UsxDocumentTests.kUsxFrameStart +
                "<para style=\"h\">header</para>" +
                "<para style=\"mt2\">The Gospel According to</para>" +
                "<para style=\"mt1\">Mark</para>" +
                "<para style=\"s1\">section</para>" +
                UsxDocumentTests.kUsxFrameEnd);
            var parser = GetUsxParser(doc);
            var blocks = parser.Parse().ToList();

            Assert.AreEqual(2, blocks.Count);
            Assert.AreEqual("mt", blocks[0].StyleTag);
            Assert.AreEqual("The Gospel According to Mark", blocks[0].GetText(false));
            Assert.AreEqual("The Gospel According to Mark", blocks[0].GetText(true));
        }
Beispiel #2
0
        public void Parse_TwoChapters_TitleIsSimplified()
        {
            var doc = UsxDocumentTests.CreateDocFromString(
                UsxDocumentTests.kUsxFrameStart +
                "<para style=\"h\">Marco</para>" +
                "<para style=\"mt2\">The Gospel According to</para>" +
                "<para style=\"mt1\">Markus</para>" +
                "<chapter number=\"1\" style=\"c\" />" +
                "<chapter number=\"2\" style=\"c\" />" +
                UsxDocumentTests.kUsxFrameEnd);
            var parser = GetUsxParser(doc);
            var blocks = parser.Parse().ToList();

            Assert.AreEqual(3, blocks.Count);
            Assert.AreEqual("mt", blocks[0].StyleTag);
            Assert.AreEqual("The Gospel According to Markus", blocks[0].GetText(false));
            Assert.AreEqual("The Gospel According to Markus", blocks[0].GetText(true));
            Assert.AreEqual("Marco", parser.PageHeader);
            Assert.AreEqual("Markus", parser.MainTitle);
        }
Beispiel #3
0
        public void Parse_ParagraphStartsWithOpeningSquareBracketBeforeVerseNumber_InitialStartVerseNumberIsBasedOnVerseNumberFollowingBracket()
        {
            var doc = UsxDocumentTests.CreateDocFromString(
                UsxDocumentTests.kUsxFrameStart +
                "<para style=\"mt1\">Markus</para>" +
                "<chapter number=\"16\" style=\"c\" />" +
                "<para style=\"p\"><verse number=\"8\" />Trembling, the women fled because they were afraid.</para>" +
                "<para style=\"p\">[<verse number=\"9\" />When Jesus rose, he first appeared to Mary. <verse number=\"10\" />" +
                "She told those who were weeping. <verse number=\"11\" />They didn't believe it.]</para>" +
                UsxDocumentTests.kUsxFrameEnd);
            var parser = GetUsxParser(doc);
            var blocks = parser.Parse().ToList();

            Assert.AreEqual(4, blocks.Count);
            Assert.AreEqual("{8}\u00A0Trembling, the women fled because they were afraid.", blocks[2].GetText(true));
            Assert.AreEqual("[{9}\u00A0When Jesus rose, he first appeared to Mary. " +
                            "{10}\u00A0She told those who were weeping. " +
                            "{11}\u00A0They didn't believe it.]", blocks[3].GetText(true));
            Assert.IsTrue(blocks[2].StartsAtVerseStart);
            Assert.AreEqual(8, blocks[2].InitialStartVerseNumber);
            Assert.IsTrue(blocks[3].StartsAtVerseStart);
            Assert.AreEqual(9, blocks[3].InitialStartVerseNumber);
        }