Example #1
0
		public void GetBCVRefAtPosWithinPara_MiddleOfPara()
		{
			CheckDisposed();

			ChapterVerseFound retVal;
			BCVRef refStart, refEnd;

			DummyScrTxtPara scrPara = new DummyScrTxtPara(Cache, m_para.Hvo);
			retVal = scrPara.GetBCVRefAtPosWithinPara(-1, 25, out refStart, out refEnd);

			// verify the results
			Assert.AreEqual(ChapterVerseFound.Verse, retVal);
			Assert.AreEqual(new BCVRef(0, 0, 16), refStart);
			Assert.AreEqual(new BCVRef(0, 0, 16), refEnd);
		}
Example #2
0
		public void GetBCVRefAtPosWithinPara_InvalidPos()
		{
			CheckDisposed();

			ChapterVerseFound retVal;
			BCVRef refStart, refEnd;

			DummyScrTxtPara scrPara = new DummyScrTxtPara(Cache, m_para.Hvo);
			retVal = scrPara.GetBCVRefAtPosWithinPara(-1, -1, out refStart, out refEnd);

			// verify the results
			Assert.AreEqual(ChapterVerseFound.None, retVal);
		}
Example #3
0
		public void GetBCVRefAtPosWithinPara_BeforeChapterNumber_AssocPrevTrue()
		{
			CheckDisposed();

			ChapterVerseFound retVal;
			BCVRef refStart, refEnd;

			DummyScrTxtPara scrPara = new DummyScrTxtPara(Cache, m_para.Hvo);
			retVal = scrPara.GetBCVRefAtPosWithinPara(-1, 20, true, out refStart, out refEnd);

			// verify the results
			Assert.AreEqual(ChapterVerseFound.Verse | ChapterVerseFound.Chapter, retVal);
			Assert.AreEqual(new BCVRef(0, 1, 1), refStart);
			Assert.AreEqual(new BCVRef(0, 1, 1), refEnd);
		}
Example #4
0
		public void GetBCVRefAtPosWithinPara_WithNonNumericChapter()
		{
			CheckDisposed();

			m_scrInMemoryCache.AddRunToMockedPara(m_para, "A", ScrStyleNames.ChapterNumber);
			m_section.AdjustReferences();

			ChapterVerseFound retVal;
			BCVRef refStart, refEnd;

			DummyScrTxtPara scrPara = new DummyScrTxtPara(Cache, m_para.Hvo);
			retVal = scrPara.GetBCVRefAtPosWithinPara(-1, m_para.Contents.Length, out refStart, out refEnd);

			// verify the results
			Assert.AreEqual(ChapterVerseFound.Verse | ChapterVerseFound.Chapter, retVal);
			Assert.AreEqual(new BCVRef(0, 2, 17), refStart);
			Assert.AreEqual(new BCVRef(0, 2, 17), refEnd);

		}
Example #5
0
		public void GetBCVRefAtPosWithinPara_AtEnd()
		{
			CheckDisposed();

			ChapterVerseFound retVal;
			BCVRef refStart, refEnd;

			DummyScrTxtPara scrPara = new DummyScrTxtPara(Cache, m_para.Hvo);
			retVal = scrPara.GetBCVRefAtPosWithinPara(-1, m_para.Contents.Length-1, out refStart,
				out refEnd);

			// verify the results
			Assert.AreEqual(ChapterVerseFound.Verse | ChapterVerseFound.Chapter, retVal);
			Assert.AreEqual(new BCVRef(0, 2, 17), refStart);
			Assert.AreEqual(new BCVRef(0, 2, 17), refEnd);
		}