Esempio n. 1
0
        private VersePointer CheckVerseParsing(string originalVerse, SimpleVersePointer expectedVerse)
        {
            var actualVerse = _versePointerFactory.CreateVersePointer(originalVerse);

            Assert.AreEqual(expectedVerse, actualVerse);

            return(actualVerse);
        }
        public void Test11()
        {
            var input = "2,3 и :1-2 как и в :3,4-5;6 и 7:8";

            CheckVerses(input, null,
                        docParseContext => docParseContext.SetTitleVerse(new ChapterEntry(versePointerFactory.CreateVersePointer("1Кор 1").ToChapterPointer())),
                        "1Кор 1:1-2", "1Кор 1:3", "1Кор 1:4-5", "1Кор 6", "1Кор 7:8"); // todo: возможно, не надо поддерживать два последних VersePointer-a

            CheckVerses(input, null,
                        docParseContext => docParseContext.SetTitleVerse(new ChapterEntry(versePointerFactory.CreateVersePointer("1Кор 1:1").ToChapterPointer())),
                        "1Кор 1:1-2", "1Кор 1:3", "1Кор 1:4-5", "1Кор 6", "1Кор 7:8");

            CheckVerses(input, null,
                        docParseContext => docParseContext.SetTitleVerse(new ChapterEntry(versePointerFactory.CreateVersePointer("1Кор 1:1-2").ToChapterPointer())),
                        "1Кор 1:1-2", "1Кор 1:3", "1Кор 1:4-5", "1Кор 6", "1Кор 7:8");

            Action action = () => CheckVerses(input, null,
                                              docParseContext => docParseContext.SetTitleVerse(new ChapterEntry(versePointerFactory.CreateVersePointer("1Кор 1-2").ToChapterPointer())));

            action.Should().Throw <InvalidOperationException>("Must be only one chapter in verse.");
        }