コード例 #1
0
        public void ParseMappingLine_CompareBaseToCustomized()
        {
            Versification vers2 = ScrVersReflectionHelper.CreateClonedVers(versification.VersInfo,
                                                                           versification.Name + "-monkey");
            ScrVers versification2 = new ScrVers(vers2);

            versification.ParseChapterVerseLine(
                "ACT 1:26 2:47 3:26 4:37 5:42 6:15 7:60 8:40 9:43 10:48 11:30 12:25 13:52 14:28 15:41 16:40 17:34 18:28 19:41 20:38 21:40 22:30 23:35 24:27 25:27 26:32 27:44 28:31");
            versification2.ParseChapterVerseLine(
                "ACT 1:26 2:47 3:26 4:37 5:42 6:15 7:60 8:40 9:43 10:48 11:30 12:25 13:52 14:28 15:41 16:40 17:34 18:28 19:41 20:38 21:40 22:30 23:35 24:27 25:27 26:32 27:44 28:31");

            versification2.ParseMappingLine("ACT 19:41 = ACT 19:40");
            versification.ParseMappingLine("ACT 19:41 = ACT 19:40");

            // Even tho we have both vers 40 and 41 mapped to the same verse, doing a conversion between the
            // two versification should not cause the original distinction to be lost if both versifications are
            // based on the same original versification.

            VerseRef vref = new VerseRef("ACT 19:40", versification);

            versification2.ChangeVersification(ref vref);
            Assert.AreEqual(new VerseRef("ACT 19:40", versification2), vref);

            vref = new VerseRef("ACT 19:41", versification);
            versification2.ChangeVersification(ref vref);
            Assert.AreEqual(new VerseRef("ACT 19:41", versification2), vref);
        }
コード例 #2
0
        public void ProcessVersLine_Custom_VerseSegments()
        {
            versification.ProcessVersLine("#! *HAG 1:5,-,a,b,c");

            // Add a custom line that updates the original verse segments
            ScrVersReflectionHelper.Merge(() => versification.ProcessVersLine("#! *HAG 1:5,d,e,f"));

            // Confirm that the expected segments are added to the specified verse.
            CheckSegments(versification, 1, new VerseRef("HAG 1:5"),
                          new[] { "d", "e", "f" });

            Assert.AreEqual(versification.VerseSegments(new VerseRef("HAG 1:5").BBBCCCVVV),
                            new[] { "d", "e", "f" });
        }
コード例 #3
0
        public void ProcessVersLine_Custom_MappingUpdated1()
        {
            versification.ProcessVersLine("PSA 119:1-15 = PSA 119:3-18");

            // Add a custom line that updates the original verse mapping
            ScrVersReflectionHelper.Merge(() =>
            {
                versification.ProcessVersLine("PSA 119:1 = PSA 119:1");
                // no longer map PSA 119:1 to PSA 119:3
                versification.ProcessVersLine("PSA 119:2-16 = PSA 119:20-34");
            });

            // Get mapping from "PSA 119:2-16 = PSA 119:20-34" in the versification
            VerseRef vref;

            for (int i = 1; i <= 16; i++)
            {
                vref = new VerseRef(19, 119, i, versification);
                ScrVers.Original.ChangeVersification(ref vref);
                if (i == 1)
                {
                    Assert.AreEqual(new VerseRef(19, 119, 1, ScrVers.Original), vref);
                    continue;
                }
                Assert.AreEqual(new VerseRef(19, 119, i + 18, ScrVers.Original), vref);
            }

            vref = new VerseRef(19, 119, 1, ScrVers.Original);
            versification.ChangeVersification(ref vref);
            Assert.AreEqual(new VerseRef(19, 119, 1, versification), vref);

            for (int i = 20; i <= 34; i++)
            {
                vref = new VerseRef(19, 119, i, ScrVers.Original);
                versification.ChangeVersification(ref vref);
                Assert.AreEqual(new VerseRef(19, 119, i - 18, versification), vref);
            }
        }