Ejemplo n.º 1
0
		public void ChapterNumberInPrevPara()
		{
			CheckDisposed();

			BCVRef refStart, refEnd;
			DummyScrTxtPara scrPara = new DummyScrTxtPara(Cache, m_para3.Hvo);
			scrPara.GetBCVRefAtPosition(5, out refStart, out refEnd);

			// verify the results
			Assert.AreEqual(new BCVRef(40, 2, 4), refStart);
			Assert.AreEqual(new BCVRef(40, 2, 4), refEnd);
		}
Ejemplo n.º 2
0
		public void NewParaInExistingSection_End()
		{
			CheckDisposed();

			// Insert a new paragraph at the end of the first section
			StTxtPara newPara = m_scrInMemoryCache.AddParaToMockedSectionContent(m_section1.Hvo,
				ScrStyleNames.NormalParagraph);
			m_scrInMemoryCache.AddRunToMockedPara(newPara, "Text at the end of the section.", null);

			BCVRef refStart, refEnd;
			DummyScrTxtPara scrPara = new DummyScrTxtPara(Cache, newPara.Hvo);
			scrPara.GetBCVRefAtPosition(1, out refStart, out refEnd);

			// verify the results
			Assert.AreEqual(new BCVRef(40, 1, 17), refStart);
			Assert.AreEqual(new BCVRef(40, 1, 17), refEnd);
		}
Ejemplo n.º 3
0
		public void ChapterNumberInPara()
		{
			CheckDisposed();

			// Insert a new paragraph at the end of the first section
			StTxtPara newPara = m_scrInMemoryCache.AddParaToMockedSectionContent(m_section1.Hvo,
				ScrStyleNames.NormalParagraph);
			m_scrInMemoryCache.AddRunToMockedPara(newPara, "42", ScrStyleNames.ChapterNumber);
			m_scrInMemoryCache.AddRunToMockedPara(newPara, "Some more text", null);

			BCVRef refStart, refEnd;
			DummyScrTxtPara scrPara = new DummyScrTxtPara(Cache, newPara.Hvo);
			scrPara.GetBCVRefAtPosition(5, out refStart, out refEnd);

			// verify the results
			Assert.AreEqual(new BCVRef(40, 42, 1), refStart);
			Assert.AreEqual(new BCVRef(40, 42, 1), refEnd);
		}
Ejemplo n.º 4
0
		public void NewParaInExistingSection_Begin()
		{
			CheckDisposed();

			// Insert a new paragraph at the beginning of the first section
			StText text = new StText(Cache, m_para1.OwnerHVO);
			StTxtPara newPara = new StTxtPara();
			text.ParagraphsOS.InsertAt(newPara, 0);
			newPara.Contents.Text = "Some text at beginning of section without previous verse";

			BCVRef refStart, refEnd;
			DummyScrTxtPara scrPara = new DummyScrTxtPara(Cache, newPara.Hvo);
			scrPara.GetBCVRefAtPosition(0, out refStart, out refEnd);

			// verify the results
			Assert.AreEqual(new BCVRef(40, 1, 15), refStart);
			Assert.AreEqual(new BCVRef(40, 1, 15), refEnd);
		}
Ejemplo n.º 5
0
		public void NewParaInNewSection()
		{
			CheckDisposed();

			IScrSection section = m_scrInMemoryCache.AddSectionToMockedBook(m_book.Hvo);
			StTxtPara para = m_scrInMemoryCache.AddParaToMockedSectionContent(section.Hvo,
				ScrStyleNames.NormalParagraph);
			m_scrInMemoryCache.AddRunToMockedPara(para, "This is a test.", null);
			section.AdjustReferences();

			BCVRef refStart, refEnd;

			DummyScrTxtPara scrPara = new DummyScrTxtPara(Cache, para.Hvo);
			scrPara.GetBCVRefAtPosition(1, out refStart, out refEnd);

			// verify the results
			Assert.AreEqual(40002005, refStart);
			Assert.AreEqual(40002005, refEnd);
		}
Ejemplo n.º 6
0
		public void FromPrevParagraph_FirstSection()
		{
			CheckDisposed();

			BCVRef refStart, refEnd;

			DummyScrTxtPara scrPara = new DummyScrTxtPara(Cache, m_para1.Hvo);
			scrPara.GetBCVRefAtPosition(-1, out refStart, out refEnd);

			// verify the results
			// for this test the needed result is not precisely defined yet
			// when it is defined, modify this to that spec, but for now...
			Assert.AreEqual(new BCVRef(40, 1, 15), refStart);  // Phm_1_0?  Phm_1_1-25
			Assert.AreEqual(new BCVRef(40, 1, 15), refEnd);
		}
Ejemplo n.º 7
0
		public void FromPrevParagraph_SecondSection()
		{
			CheckDisposed();

			BCVRef refStart, refEnd;

			DummyScrTxtPara scrPara = new DummyScrTxtPara(Cache, m_para3.Hvo);
			scrPara.GetBCVRefAtPosition(-1, out refStart, out refEnd);

			// verify the results
			Assert.AreEqual(new BCVRef(40, 2, 3), refStart);
			Assert.AreEqual(new BCVRef(40, 2, 3), refEnd);
		}
Ejemplo n.º 8
0
		public void StartOfPara_StartOfSection()
		{
			CheckDisposed();

			BCVRef refStart, refEnd;

			DummyScrTxtPara scrPara = new DummyScrTxtPara(Cache, m_para1.Hvo);
			scrPara.GetBCVRefAtPosition(0, out refStart, out refEnd);

			// verify the results
			Assert.AreEqual(new BCVRef(40, 1, 15), refStart);
			Assert.AreEqual(new BCVRef(40, 1, 15), refEnd);
		}