public void RemoveAllUnknownVersifications() { Assert.IsFalse(Versification.Table.Implementation.Exists("ModifiedRuth")); using (TextReader reader = new StringReader("RUT 5:91")) Versification.Table.Implementation.Load(reader, "", ScrVers.English, "ModifiedRuth"); Assert.IsTrue(Versification.Table.Implementation.Exists("ModifiedRuth")); ScrVers modRuth = new ScrVers("ModifiedRuth"); Assert.AreEqual(5, modRuth.GetLastChapter(Canon.BookIdToNumber("RUT"))); Assert.AreEqual(91, modRuth.GetLastVerse(Canon.BookIdToNumber("RUT"), 5)); Versification.Table.Implementation.RemoveAllUnknownVersifications(); Assert.IsFalse(Versification.Table.Implementation.Exists("ModifiedRuth")); modRuth = new ScrVers("ModifiedRuth"); Assert.AreEqual(4, modRuth.GetLastChapter(Canon.BookIdToNumber("RUT"))); Assert.AreEqual(22, modRuth.GetLastVerse(Canon.BookIdToNumber("RUT"), 4)); }
public int LastVerse(int bookNum, int chapter) { return(pt8Versification.GetLastVerse(bookNum, chapter)); }
public void ParseChapterVerseLine() { versification.ParseChapterVerseLine("HAB 1:17 2:20 3:19"); int bookId = Canon.BookIdToNumber("HAB"); List <int[]> bookList = versification.bookList(); Assert.AreEqual(bookList.Count, bookId); Assert.AreEqual(bookList[bookId - 1], new [] { 17, 20, 19 }); Assert.AreEqual(bookId, versification.GetLastBook(), "HAB should be the last book in the versification"); Assert.AreEqual(3, versification.GetLastChapter(bookId), "HAB has three chapters"); Assert.AreEqual(17, versification.GetLastVerse(bookId, 1), "HAB 1 has 17 verses"); Assert.AreEqual(20, versification.GetLastVerse(bookId, 2), "HAB 2 has 20 verses"); Assert.AreEqual(19, versification.GetLastVerse(bookId, 3), "HAB 3 has 19 verses"); }