Ejemplo n.º 1
0
		public void ValidBCVRefs()
		{
			BCVRef bcvRef = new BCVRef(1, 2, 3, 0);
			Assert.IsTrue(bcvRef.Valid);
			Assert.AreEqual(1002003, bcvRef);
			Assert.AreEqual(1, bcvRef.Book);
			Assert.AreEqual(2, bcvRef.Chapter);
			Assert.AreEqual(3, bcvRef.Verse);

			bcvRef = new BCVRef(4005006);
			Assert.IsTrue(bcvRef.Valid);
			Assert.AreEqual(4005006, bcvRef);
			Assert.AreEqual(4, bcvRef.Book);
			Assert.AreEqual(5, bcvRef.Chapter);
			Assert.AreEqual(6, bcvRef.Verse);

			bcvRef = new BCVRef();
			Assert.IsFalse(bcvRef.Valid);
			Assert.AreEqual(0, bcvRef);
			Assert.AreEqual(0, bcvRef.Book);
			Assert.AreEqual(0, bcvRef.Chapter);
			Assert.AreEqual(0, bcvRef.Verse);
		}
Ejemplo n.º 2
0
		public void ParseRefRange_BogusReferenceRange_MoreThanTwoRefs()
		{
			BCVRef bcvRefStart = new BCVRef(41, 2, 3);
			BCVRef bcvRefEnd = new BCVRef(41, 2, 3);
			Assert.IsFalse(BCVRef.ParseRefRange("GEN 4:5 - MAT 6:8 - REV 1:9", ref bcvRefStart, ref bcvRefEnd));
			Assert.AreEqual(new BCVRef(41, 2, 3), bcvRefStart, "Since ParseRefRange failed, the reference should be unchanged");
			Assert.AreEqual(new BCVRef(41, 2, 3), bcvRefEnd, "Since ParseRefRange failed, the reference should be unchanged");
		}
Ejemplo n.º 3
0
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Generates a cannonical text form of the given reference, consisting of
		/// book abbreviation (in primary writing system), chapter nbr, colon, verse nbr.
		/// </summary>
		/// <param name="scRef">The given scReference object.</param>
		/// <returns>The generated text string reference.</returns>
		/// ------------------------------------------------------------------------------------
		public virtual string GetRefString(BCVRef scRef)
		{
			return scRef.AsString;
			// GetAbbrev, replace 1st 3 with new abbrev
		}
Ejemplo n.º 4
0
		public void ParseRefRange_NormalVerseRange_BookSpecifiedTwice()
		{
			BCVRef bcvRefStart = new BCVRef();
			BCVRef bcvRefEnd = new BCVRef();
			Assert.IsTrue(BCVRef.ParseRefRange("MRK 1:8-MRK 2:15", ref bcvRefStart, ref bcvRefEnd));
			Assert.AreEqual(new BCVRef(41, 1, 8), bcvRefStart);
			Assert.AreEqual(new BCVRef(41, 2, 15), bcvRefEnd);
		}
Ejemplo n.º 5
0
		public void BuildBcvRefByProps()
		{
			// Build a bcvRef by individual properties
			BCVRef bcvRef = new BCVRef();

			bcvRef.Book = 13;
			Assert.IsFalse(bcvRef.Valid); // 0 not allowed for chapter
			Assert.AreEqual(13000000, bcvRef.BBCCCVVV);
			Assert.AreEqual(13, bcvRef.Book);
			Assert.AreEqual(0, bcvRef.Chapter);
			Assert.AreEqual(0, bcvRef.Verse);

			bcvRef.Chapter = 1;
			// a zero verse is considered valid for introduction, etc, but only for chapter 1
			Assert.IsTrue(bcvRef.Valid);
			Assert.AreEqual(13001000, (int)bcvRef);
			Assert.AreEqual(13, bcvRef.Book);
			Assert.AreEqual(1, bcvRef.Chapter);
			Assert.AreEqual(0, bcvRef.Verse);

			bcvRef.Chapter = 14;
			bcvRef.Verse = 15;
			Assert.IsTrue(bcvRef.Valid);
			Assert.AreEqual(13014015, (int)bcvRef);
			Assert.AreEqual(13, bcvRef.Book);
			Assert.AreEqual(14, bcvRef.Chapter);
			Assert.AreEqual(15, bcvRef.Verse);

			bcvRef = new BCVRef();
			bcvRef.Chapter = 16;
			Assert.IsFalse(bcvRef.Valid, "Invalid because 0 is not valid for the book number");
			Assert.AreEqual(00016000, (int)bcvRef);
			Assert.AreEqual(0, bcvRef.Book);
			Assert.AreEqual(16, bcvRef.Chapter);
			Assert.AreEqual(0, bcvRef.Verse);

			bcvRef = new BCVRef();
			bcvRef.Verse = 17;
			Assert.IsFalse(bcvRef.Valid, "Invalid because 0 is not valid for the book and chapter numbers");
			Assert.AreEqual(00000017, (int)bcvRef);
			Assert.AreEqual(0, bcvRef.Book);
			Assert.AreEqual(0, bcvRef.Chapter);
			Assert.AreEqual(17, bcvRef.Verse);

			// same tests as above except that we test individual properties first
			// the BCVRef object operates differently in this circumstance
			bcvRef = new BCVRef();
			bcvRef.Book = 21;
			Assert.AreEqual(0, bcvRef.Verse);
			Assert.AreEqual(0, bcvRef.Chapter);
			Assert.AreEqual(21, bcvRef.Book);
			Assert.AreEqual(21000000, (int)bcvRef);
			Assert.IsFalse(bcvRef.Valid, "Invalid because 0 is not valid for the chapter number");

			bcvRef = new BCVRef();
			bcvRef.Chapter = 22;
			Assert.AreEqual(0, bcvRef.Verse);
			Assert.AreEqual(22, bcvRef.Chapter);
			Assert.AreEqual(0, bcvRef.Book);
			Assert.AreEqual(00022000, (int)bcvRef);
			Assert.IsFalse(bcvRef.Valid, "Invalid because 0 is not valid for the book number");

			bcvRef = new BCVRef();
			bcvRef.Verse = 23;
			Assert.AreEqual(23, bcvRef.Verse);
			Assert.AreEqual(0, bcvRef.Chapter);
			Assert.AreEqual(0, bcvRef.Book);
			Assert.AreEqual(00000023, (int)bcvRef);
			Assert.IsFalse(bcvRef.Valid, "Invalid because 0 is not valid for the book and chapter numbers");
		}
Ejemplo n.º 6
0
		public void ParseTest()
		{
			BCVRef bcvRef = new BCVRef();

			// Note: Don't break into individual unit tests because this test also makes sure
			// that the results of a previous parse don't have unintended consequences for a
			// subsequent parse.

			// Test a normal reference
			bcvRef.Parse("EXO 9:32");
			Assert.AreEqual(2, bcvRef.Book);
			Assert.AreEqual(9, bcvRef.Chapter);
			Assert.AreEqual(32, bcvRef.Verse);

			// Test a bogus book
			bcvRef.Parse("GYQ 8:12");
			Assert.AreEqual(0, bcvRef.Book);
			Assert.AreEqual(9, bcvRef.Chapter);
			Assert.AreEqual(32, bcvRef.Verse);

			// Test large chapter and verse numbers
			bcvRef.Parse("MAT 1000:2500");
			Assert.AreEqual(40, bcvRef.Book);
			Assert.AreEqual(1000, bcvRef.Chapter);
			Assert.AreEqual(2500, bcvRef.Verse);

			// Test no chapter or verse number
			bcvRef.Parse("REV");
			Assert.AreEqual(66, bcvRef.Book);
			Assert.AreEqual(1, bcvRef.Chapter);
			Assert.AreEqual(1, bcvRef.Verse);

			// Test empty string - should not crash
			bcvRef.Parse("");
			Assert.AreEqual(0, bcvRef.Book);
			Assert.AreEqual(1, bcvRef.Chapter);
			Assert.AreEqual(1, bcvRef.Verse);

			// Test no verse number
			bcvRef.Parse("LUK 5");
			Assert.AreEqual(42, bcvRef.Book);
			Assert.AreEqual(5, bcvRef.Chapter);
			Assert.AreEqual(1, bcvRef.Verse);

			// Test invalid format
			bcvRef.Parse("ROM 5!3@4");
			Assert.AreEqual(0, bcvRef.Book);
			Assert.AreEqual(5, bcvRef.Chapter);
			Assert.AreEqual(3, bcvRef.Verse);

		}
Ejemplo n.º 7
0
		public void Parse_Intro()
		{
			BCVRef genesisTitleRef = new BCVRef("GEN Intro");
			Assert.AreEqual(1, genesisTitleRef.Book);
			Assert.AreEqual(1, genesisTitleRef.Chapter);
			Assert.AreEqual(0, genesisTitleRef.Verse);
		}
Ejemplo n.º 8
0
		public void ToString_BogusIntro()
		{
			BCVRef genesisTitleRef = new BCVRef(1002000);
			Assert.AreEqual("GEN 2:0", genesisTitleRef.ToString(BCVRef.RefStringFormat.General));
			Assert.AreEqual("GEN 2:0", genesisTitleRef.ToString(BCVRef.RefStringFormat.Exchange));
		}
Ejemplo n.º 9
0
		public void ParseRefString_OnlyChapter()
		{
			BCVRef reference = new BCVRef("EXO 1");
			Assert.IsTrue(reference.Valid);
			Assert.AreEqual(02001001, reference.BBCCCVVV);
		}
Ejemplo n.º 10
0
		public void ParseRefString_ValidExtraSpace()
		{
			BCVRef reference = new BCVRef("GEN 1 : 1");
			Assert.IsTrue(reference.Valid);
			Assert.AreEqual(01001001, reference.BBCCCVVV);
		}
Ejemplo n.º 11
0
		public void UpdateBcvRef()
		{
			// Test updating book
			BCVRef bcvRef = new BCVRef(1001001);
			bcvRef.Book = 2;
			int encodedBCV = bcvRef;
			Assert.AreEqual(2001001, encodedBCV);

			// Test updating chapter
			bcvRef = new BCVRef(1001001);
			bcvRef.Chapter = 2;
			encodedBCV = bcvRef;
			Assert.AreEqual(1002001, encodedBCV);

			// Test updating verse
			bcvRef = new BCVRef(1001001);
			bcvRef.Verse = 2;
			encodedBCV = bcvRef;
			Assert.AreEqual(1001002, encodedBCV);
		}
Ejemplo n.º 12
0
		public void ParseRefRange_NormalReferenceRange_SubVerseLetter()
		{
			BCVRef bcvRefStart = new BCVRef();
			BCVRef bcvRefEnd = new BCVRef();
			Assert.IsTrue(BCVRef.ParseRefRange("LUK 9.37-43a", ref bcvRefStart, ref bcvRefEnd, true));
			Assert.AreEqual(new BCVRef(42, 9, 37), bcvRefStart);
			Assert.AreEqual(new BCVRef(42, 9, 43), bcvRefEnd);
		}
Ejemplo n.º 13
0
		public void ParseRefRange_BogusReferenceRange_Backwards()
		{
			BCVRef bcvRefStart = new BCVRef();
			BCVRef bcvRefEnd = new BCVRef();
			Assert.IsFalse(BCVRef.ParseRefRange("MRK 2:5-MRK 1:2", ref bcvRefStart, ref bcvRefEnd));
		}
Ejemplo n.º 14
0
		public void ParseRefRange_BogusReferenceRange_MultipleBooks()
		{
			BCVRef bcvRefStart = new BCVRef();
			BCVRef bcvRefEnd = new BCVRef();
			Assert.IsFalse(BCVRef.ParseRefRange("MAT 1:5-REV 12:2", ref bcvRefStart, ref bcvRefEnd, false));
		}
Ejemplo n.º 15
0
		public void ParseRefRange_NormalReferenceRange_MultipleBooks()
		{
			BCVRef bcvRefStart = new BCVRef();
			BCVRef bcvRefEnd = new BCVRef();
			Assert.IsTrue(BCVRef.ParseRefRange("MAT 1:5-REV 12:2", ref bcvRefStart, ref bcvRefEnd, true));
			Assert.AreEqual(new BCVRef(40, 1, 5), bcvRefStart);
			Assert.AreEqual(new BCVRef(66, 12, 2), bcvRefEnd);
		}
Ejemplo n.º 16
0
		public void Invalid()
		{
			BCVRef scrRef = new BCVRef(6542, 1023, 5051);
			Assert.IsFalse(scrRef.Valid);
			Assert.AreEqual(42023051, scrRef);
		}
Ejemplo n.º 17
0
		public void ToString_Title()
		{
			BCVRef genesisTitleRef = new BCVRef(1000000);
			Assert.AreEqual("GEN 0:0", genesisTitleRef.ToString(BCVRef.RefStringFormat.General));
			Assert.AreEqual("GEN Title", genesisTitleRef.ToString(BCVRef.RefStringFormat.Exchange));
		}
Ejemplo n.º 18
0
		public void ParseRefString_OnlyBook()
		{
			BCVRef reference = new BCVRef("LEV");
			Assert.IsTrue(reference.Valid);
			Assert.AreEqual(03001001, reference.BBCCCVVV);
		}
Ejemplo n.º 19
0
		public void ToString_NormalVerse()
		{
			BCVRef exodusTitleRef = new BCVRef(2004006);
			Assert.AreEqual("EXO 4:6", exodusTitleRef.ToString(BCVRef.RefStringFormat.General));
			Assert.AreEqual("EXO 4:6", exodusTitleRef.ToString(BCVRef.RefStringFormat.Exchange));
		}
Ejemplo n.º 20
0
        public void ParseRefString_ChapterOptionalForSingleChapterBooks()
        {
            BCVRef reference = new BCVRef("OBA 2");
            Assert.IsTrue(reference.Valid);
            Assert.AreEqual(31001002, reference.BBCCCVVV);

            BCVRef start = new BCVRef();
            BCVRef end = new BCVRef();
            BCVRef.ParseRefRange("PHM 23-25", ref start, ref end);
            Assert.IsTrue(start.Valid);
            Assert.IsTrue(end.Valid);
            Assert.AreEqual(57001023, start.BBCCCVVV);
            Assert.AreEqual(57001025, end.BBCCCVVV);

            reference = new BCVRef("2JN 8");
            Assert.IsTrue(reference.Valid);
            Assert.AreEqual(63001008, reference.BBCCCVVV);

            BCVRef.ParseRefRange("3JN 12-15", ref start, ref end, false);
            Assert.IsTrue(start.Valid);
            Assert.IsTrue(end.Valid);
            Assert.AreEqual(64001012, start.BBCCCVVV);
            Assert.AreEqual(64001015, end.BBCCCVVV);

            BCVRef.ParseRefRange("JUD 10-24", ref start, ref end, false);
            Assert.IsTrue(start.Valid);
            Assert.IsTrue(end.Valid);
            Assert.AreEqual(65001010, start.BBCCCVVV);
            Assert.AreEqual(65001024, end.BBCCCVVV);

            // Test to make sure non-single chapter book doesn't get away with any funny business!
            reference = new BCVRef("EXO 3-4");
            Assert.IsTrue(reference.Valid);
            // May not seem right or logical, but BCVRef doesn't hard-code a particular chapter-verse separator character.
            Assert.AreEqual(02003004, reference.BBCCCVVV);
        }
Ejemplo n.º 21
0
		public void VerseToScrRefTest_LargeVerseNumber()
		{
			BCVRef startVerse = new BCVRef();
			BCVRef endVerse = new BCVRef();
			string literal, remaining;
			bool convertSuccessful;

			// Test a really large number that will pass the Int16.MaxValue
			convertSuccessful = BCVRef.VerseToScrRef("5200000000000", out literal,
				out remaining, ref startVerse, ref endVerse);
			Assert.AreEqual(0, startVerse.Verse);
			Assert.AreEqual(0, endVerse.Verse);
			Assert.IsFalse(convertSuccessful);

			// Test a verse number just under the limit
			convertSuccessful = BCVRef.VerseToScrRef("32766", out literal,
				out remaining, ref startVerse, ref endVerse);
			Assert.AreEqual(32766, startVerse.Verse);
			Assert.AreEqual(32766, endVerse.Verse);
			Assert.IsTrue(convertSuccessful);
		}
Ejemplo n.º 22
0
		public void ParseRefString_Bridge()
		{
			BCVRef reference = new BCVRef("NUM 5:1-5");
			Assert.IsFalse(reference.Valid);
		}
Ejemplo n.º 23
0
		public void VerseToScrRefTest()
		{
			BCVRef startVerse = new BCVRef();
			BCVRef endVerse = new BCVRef();
			string literal, remaining = string.Empty;
			bool convertSuccessful;

			// Test invalid verse number strings
			convertSuccessful = BCVRef.VerseToScrRef("-12", out literal, out remaining, ref startVerse, ref endVerse);
			//Assert.AreEqual(12, startVerse.Verse); // start verse set to 0 instead of 12
			Assert.AreEqual(12, endVerse.Verse);
			//Assert.IsFalse(convertSuccessful);	// Does not detect invalid verse number format.
			convertSuccessful = BCVRef.VerseToScrRef("12-", out literal, out remaining, ref startVerse, ref endVerse);
			Assert.AreEqual(12, startVerse.Verse);
			Assert.AreEqual(12, endVerse.Verse);
			//Assert.IsFalse(convertSuccessful); // Does not detect invalid verse number format.
			convertSuccessful = BCVRef.VerseToScrRef("a3", out literal, out remaining, ref startVerse, ref endVerse);
			//Assert.AreEqual(3, startVerse.Verse); // does not set starting verse value
			//Assert.AreEqual(3, endVerse.Verse); // does not set end verse value
			Assert.IsFalse(convertSuccessful);
			convertSuccessful = BCVRef.VerseToScrRef("15b-a", out literal, out remaining, ref startVerse, ref endVerse);
			Assert.AreEqual(15, startVerse.Verse);
			Assert.AreEqual(15, endVerse.Verse);
			//Assert.IsFalse(convertSuccessful); // Does not detect invalid verse number format.
			convertSuccessful = BCVRef.VerseToScrRef("3bb", out literal, out remaining, ref startVerse, ref endVerse);
			Assert.AreEqual(3, startVerse.Verse);
			Assert.AreEqual(3, endVerse.Verse);
			//Assert.IsFalse(convertSuccessful); // Does not detect invalid verse number format.
			convertSuccessful = BCVRef.VerseToScrRef("0", out literal, out remaining, ref startVerse, ref endVerse);
			Assert.AreEqual(0, startVerse.Verse);
			Assert.AreEqual(0, endVerse.Verse);
			//Assert.IsFalse(convertSuccessful); // Does not detect invalid verse number format.
			convertSuccessful = BCVRef.VerseToScrRef(" 12", out literal, out remaining, ref startVerse, ref endVerse);
			Assert.AreEqual(12, startVerse.Verse);
			Assert.AreEqual(12, endVerse.Verse);
			//Assert.IsFalse(convertSuccessful); // Does not detect invalid verse number format.
			convertSuccessful = BCVRef.VerseToScrRef("12 ", out literal, out remaining, ref startVerse, ref endVerse);
			Assert.AreEqual(12, startVerse.Verse);
			Assert.AreEqual(12, endVerse.Verse);
			//Assert.IsFalse(convertSuccessful); // Does not detect invalid verse number format.
			convertSuccessful = BCVRef.VerseToScrRef("12-10", out literal, out remaining, ref startVerse, ref endVerse);
			Assert.AreEqual(12, startVerse.Verse); // out of order
			//Assert.AreEqual(12, endVerse.Verse); // end verse set to 12 instead of 10
			//Assert.IsFalse(convertSuccessful); // Does not detect invalid verse number format.
            convertSuccessful = BCVRef.VerseToScrRef("1-176", out literal, out remaining, ref startVerse, ref endVerse);
            Assert.AreEqual(1, startVerse.Verse);
            Assert.AreEqual(176, endVerse.Verse);
            Assert.IsTrue(convertSuccessful);
            convertSuccessful = BCVRef.VerseToScrRef("139-1140", out literal, out remaining, ref startVerse, ref endVerse);
			Assert.AreEqual(139, startVerse.Verse); // 1140 is out of range of valid verse numbers
			//Assert.AreEqual(139, endVerse.Verse); // end verse set to 1140 instead of 139
			//Assert.IsFalse(convertSuccessful); // Does not detect invalid verse number format.
			convertSuccessful = BCVRef.VerseToScrRef("177-140", out literal, out remaining, ref startVerse, ref endVerse);
			//Assert.AreEqual(140, startVerse.Verse); // 177 is out of range of valid verse numbers
			Assert.AreEqual(140, endVerse.Verse);
			//Assert.IsFalse(convertSuccessful); // Does not detect invalid verse number format.
			//Review: should this be a requirement?
			//			convertSuccessful = BCVRef.VerseToScrRef("177", out literal, out remaining, ref startVerse, ref endVerse);
			//			Assert.AreEqual(0, startVerse.Verse); // 177 is out of range of valid verse numbers
			//			Assert.AreEqual(0, endVerse.Verse);
			//Assert.IsFalse(convertSuccessful);
			convertSuccessful = BCVRef.VerseToScrRef(String.Empty, out literal, out remaining, ref startVerse, ref endVerse);
			Assert.AreEqual(0, startVerse.Verse);
			Assert.AreEqual(0, endVerse.Verse);
			//Assert.IsFalse(convertSuccessful); // Does not detect invalid verse number format.
			convertSuccessful = BCVRef.VerseToScrRef(String.Empty, out literal, out remaining, ref startVerse, ref endVerse);
			Assert.AreEqual(0, startVerse.Verse);
			Assert.AreEqual(0, endVerse.Verse);
			//Assert.IsFalse(convertSuccessful); // Does not detect invalid verse number format.

			// Test valid verse number strings
			convertSuccessful = BCVRef.VerseToScrRef("1a", out literal, out remaining, ref startVerse, ref endVerse);
			Assert.AreEqual(1, startVerse.Verse);
			Assert.AreEqual(1, endVerse.Verse);
			Assert.IsTrue(convertSuccessful);
			convertSuccessful = BCVRef.VerseToScrRef("2a-3b", out literal, out remaining, ref startVerse, ref endVerse);
			Assert.AreEqual(2, startVerse.Verse);
			Assert.AreEqual(3, endVerse.Verse);
			Assert.IsTrue(convertSuccessful);
			convertSuccessful = BCVRef.VerseToScrRef("4-5d", out literal, out remaining, ref startVerse, ref endVerse);
			Assert.AreEqual(4, startVerse.Verse);
			Assert.AreEqual(5, endVerse.Verse);
			Assert.IsTrue(convertSuccessful);
			convertSuccessful = BCVRef.VerseToScrRef("6", out literal, out remaining, ref startVerse, ref endVerse);
			Assert.AreEqual(6, startVerse.Verse);
			Assert.AreEqual(6, endVerse.Verse);
			Assert.IsTrue(convertSuccessful);
			convertSuccessful = BCVRef.VerseToScrRef("66", out literal, out remaining, ref startVerse, ref endVerse);
			Assert.AreEqual(66, startVerse.Verse);
			Assert.AreEqual(66, endVerse.Verse);
			Assert.IsTrue(convertSuccessful);
			convertSuccessful = BCVRef.VerseToScrRef("176", out literal, out remaining, ref startVerse, ref endVerse);
			Assert.AreEqual(176, startVerse.Verse);
			Assert.AreEqual(176, endVerse.Verse);
			Assert.IsTrue(convertSuccessful);
			//We expect this test to pass
			//RTL verse bridge should be valid syntax
			convertSuccessful = BCVRef.VerseToScrRef("6" + '\u200f' + "-" + '\u200f' + "8", out literal, out remaining,
				ref startVerse, ref endVerse);
			Assert.AreEqual(6, startVerse.Verse);
			Assert.AreEqual(8, endVerse.Verse);
			Assert.IsTrue(convertSuccessful);
		}
Ejemplo n.º 24
0
		public void ParseRefString_Intro()
		{
			BCVRef reference = new BCVRef("JOS 1:0");
			Assert.IsTrue(reference.Valid);
			Assert.AreEqual(06001000, reference.BBCCCVVV);
		}
Ejemplo n.º 25
0
 public void ParseRefRange_NormalVerseRange_MaxVerseNumber()
 {
     BCVRef bcvRefStart = new BCVRef();
     BCVRef bcvRefEnd = new BCVRef();
     Assert.IsTrue(BCVRef.ParseRefRange("PSA 119:175-176", ref bcvRefStart, ref bcvRefEnd));
     Assert.AreEqual(new BCVRef(19, 119, 175), bcvRefStart);
     Assert.AreEqual(new BCVRef(19, 119, 176), bcvRefEnd);
     Assert.IsTrue(BCVRef.ParseRefRange("174-176", ref bcvRefStart, ref bcvRefEnd));
     Assert.AreEqual(new BCVRef(19, 119, 174), bcvRefStart);
     Assert.AreEqual(new BCVRef(19, 119, 176), bcvRefEnd);
 }
Ejemplo n.º 26
0
		public void ParseRefString_IntroInvalid()
		{
			BCVRef reference = new BCVRef("JOS 2:0");
			Assert.IsFalse(reference.Valid, "Verse cannot be 0 except in chapter 1.");
		}
Ejemplo n.º 27
0
		public void ParseRefRange_ValidBBCCCVVVRange()
		{
			BCVRef bcvRefStart = new BCVRef();
			BCVRef bcvRefEnd = new BCVRef();
			Assert.IsTrue(BCVRef.ParseRefRange("40001002-41002006", ref bcvRefStart, ref bcvRefEnd, true));
			Assert.AreEqual(new BCVRef(40, 1, 2), bcvRefStart);
			Assert.AreEqual(new BCVRef(41, 2, 6), bcvRefEnd);
		}
Ejemplo n.º 28
0
		public void ParseRefString_InvalidBook()
		{
			BCVRef reference = new BCVRef("BLA 1:1");
			Assert.IsFalse(reference.Valid);
		}
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Notify all Santa Fe windows that a Scripture Reference focus change has occured.
		/// </summary>
		/// <param name="sRef">The string representation of the reference (e.g. MAT 1:1)</param>
		/// ------------------------------------------------------------------------------------
		public static void SendFocusMessage(string sRef)
		{
			BCVRef bcvRef = new BCVRef(sRef);
			if (!bcvRef.Valid)
				return;
			s_SantaFeRefKey.SetValue(null, sRef);
			PostMessage(new IntPtr(-1), s_FocusMsg, (uint)FocusTypes.ScriptureReferenceFocus, 0);
		}
Ejemplo n.º 30
0
		public void ParseRefRange_BogusReferenceRange_Unintelligible()
		{
			BCVRef bcvRefStart = new BCVRef(41, 2, 3);
			BCVRef bcvRefEnd = new BCVRef(41, 2, 3);
			Assert.IsFalse(BCVRef.ParseRefRange("XYZ 3:4&6:7", ref bcvRefStart, ref bcvRefEnd));
			Assert.AreEqual(new BCVRef(41, 2, 3), bcvRefStart, "Since ParseRefRange failed, the reference should be unchanged");
			Assert.AreEqual(new BCVRef(41, 2, 3), bcvRefEnd, "Since ParseRefRange failed, the reference should be unchanged");
		}