Пример #1
0
        public void FixOrcsWithoutProps_OrcForMissingObject()
        {
            CheckDisposed();

            IScrBook  exodus = CreateExodusData();
            StTxtPara para   = AddPara(exodus.SectionsOS[2]);

            AddVerse(para, 2, 3, "ORC is here, you see, my friend.");

            // Update the paragraph contents to include the picture
            ITsStrBldr    tsStrBldr = para.Contents.UnderlyingTsString.GetBldr();
            ITsStrFactory factory   = TsStrFactoryClass.Create();

            StringUtils.InsertOrcIntoPara(Guid.NewGuid(), FwObjDataTypes.kodtOwnNameGuidHot,
                                          tsStrBldr, 11, 11, 0);
            para.Contents.UnderlyingTsString = tsStrBldr.GetString();

            TeScrInitializer scrInit = new TestTeScrInitializer(Cache);
            List <string>    report  = (List <string>)ReflectionHelper.GetResult(scrInit, "FixOrcsWithoutProps");

            VerifyNoOrphanedFootnotes();
            VerifyResourceForFixedOrphans();

            Assert.AreEqual(1, report.Count);
            Assert.AreEqual("EXO 2:3 - Deleted corrupted footnote marker or picture anchor", report[0]);

            Assert.AreEqual(0, exodus.FootnotesOS.Count);
        }
Пример #2
0
        public void FixOrcsWithoutProps_OrphanedFootnotesOutOfOrder()
        {
            CheckDisposed();

            IScrBook exodus = CreateExodusData();

            CreateFootnote(exodus, 0, 0, 0, 4, ScrStyleNames.NormalFootnoteParagraph, false);
            CreateFootnote(exodus, 1, 0, 1, 7, ScrStyleNames.NormalFootnoteParagraph, true);
            CreateFootnote(exodus, 2, 0, 1 /* this causes this footnote to get inserted before the preceding one*/,
                           7, ScrStyleNames.CrossRefFootnoteParagraph, false);
            CreateFootnote(exodus, 2, 0, 3, 14, ScrStyleNames.NormalFootnoteParagraph, true);

            TeScrInitializer scrInit = new TestTeScrInitializer(Cache);
            List <string>    report  = (List <string>)ReflectionHelper.GetResult(scrInit, "FixOrcsWithoutProps");

            VerifyResourceForFixedOrphans();

            Assert.AreEqual(3, report.Count);
            Assert.AreEqual("EXO 1:1 - Deleted corrupted footnote marker or picture anchor", report[0]);
            // Note that the last ORC gets hooked up to the first orpaned footnote, rather than to
            // its original footnote, leaving the last one as an orphan still.
            Assert.AreEqual("EXO 1:7 - Connected footnote to marker in the vernacular text", report[1]);
            Assert.AreEqual("EXO - Footnote 4 has no corresponding marker in the vernacular text", report[2]);

            Assert.AreEqual(4, exodus.FootnotesOS.Count);
        }
Пример #3
0
        public void FixOrcsWithoutProps_OrphanedFootnoteAndValidPicture()
        {
            CheckDisposed();

            IScrBook  exodus = CreateExodusData();
            StTxtPara para   = AddPara(exodus.SectionsOS[2]);

            AddVerse(para, 2, 3, "ORC is here, you see, my friend.");

            // Update the paragraph contents to include the picture
            ITsStrBldr    tsStrBldr = para.Contents.UnderlyingTsString.GetBldr();
            ITsStrFactory factory   = TsStrFactoryClass.Create();
            CmPicture     pict      = new CmPicture(Cache, "c:\\junk.jpg",
                                                    factory.MakeString("Test picture", Cache.DefaultVernWs),
                                                    StringUtils.LocalPictures);

            Assert.IsNotNull(pict);
            pict.InsertOwningORCIntoPara(tsStrBldr, 11, 0);
            para.Contents.UnderlyingTsString = tsStrBldr.GetString();

            // Update the paragraph contents to include the (orphaned) footnote marker
            CreateFootnote(exodus, 1, 0, 1, 19, ScrStyleNames.CrossRefFootnoteParagraph, true);

            TeScrInitializer scrInit = new TestTeScrInitializer(Cache);
            List <string>    report  = (List <string>)ReflectionHelper.GetResult(scrInit, "FixOrcsWithoutProps");

            VerifyNoOrphanedFootnotes();
            VerifyResourceForFixedOrphans();

            Assert.AreEqual(1, report.Count);
            Assert.AreEqual("EXO 1:2 - Deleted corrupted footnote marker or picture anchor", report[0]);

            Assert.AreEqual(0, exodus.FootnotesOS.Count);
        }
Пример #4
0
        public override void Initialize()
        {
            CheckDisposed();
            base.Initialize();

            m_scrInitializer = new TestTeScrInitializer(Cache);
        }
Пример #5
0
        public void FixOrcsWithoutProps_OrphanedFootnotesInTitleIntroAndHeading()
        {
            CheckDisposed();

            IScrBook exodus = CreateExodusData();

            CreateFootnote(exodus, exodus.TitleOA, 0, 0, 0, ScrStyleNames.NormalFootnoteParagraph, true);
            CreateFootnote(exodus, 0, 0, 1, 9, ScrStyleNames.NormalFootnoteParagraph, true);
            CreateFootnote(exodus, 1, 0, 2, 7, ScrStyleNames.NormalFootnoteParagraph, false);
            CreateFootnote(exodus, exodus.SectionsOS[2].HeadingOA, 0, 3, 7, ScrStyleNames.NormalFootnoteParagraph, true);
            CreateFootnote(exodus, 2, 0, 4, 13, ScrStyleNames.NormalFootnoteParagraph, false);

            TeScrInitializer scrInit = new TestTeScrInitializer(Cache);
            List <string>    report  = (List <string>)ReflectionHelper.GetResult(scrInit, "FixOrcsWithoutProps");

            VerifyNoOrphanedFootnotes();
            VerifyResourceForFixedOrphans();

            Assert.AreEqual(3, report.Count);
            Assert.AreEqual("EXO Title - Connected footnote to marker in the vernacular text", report[0]);
            Assert.AreEqual("EXO Intro Section 1, Contents - Connected footnote to marker in the vernacular text", report[1]);
            Assert.AreEqual("EXO 1:6-7 Section Heading - Connected footnote to marker in the vernacular text", report[2]);

            Assert.AreEqual(5, exodus.FootnotesOS.Count);
        }
Пример #6
0
        public override void Exit()
        {
            CheckDisposed();

            m_scrInitializer = null;

            base.Exit();
        }
Пример #7
0
        public void FixOrcsWithoutProps_NoFootnotesInProject()
        {
            IScrBook exodus = CreateExodusData();

            TeScrInitializer scrInit = new TestTeScrInitializer(Cache);

            Assert.IsNull(ReflectionHelper.GetResult(scrInit, "FixOrcsWithoutProps"));

            VerifyNoOrphanedFootnotes();
            VerifyResourceForFixedOrphans();
            Assert.AreEqual(0, exodus.FootnotesOS.Count);
        }
Пример #8
0
        public void FixOrcsWithoutProps_AllFootnotesAreOkay()
        {
            IScrBook exodus = CreateExodusData();

            CreateFootnote(exodus, 0, 0, 0, 4, ScrStyleNames.NormalFootnoteParagraph, false);
            CreateFootnote(exodus, 2, 0, 1, 7, ScrStyleNames.NormalFootnoteParagraph, false);

            TeScrInitializer scrInit = new TestTeScrInitializer(Cache);

            Assert.IsNull(ReflectionHelper.GetResult(scrInit, "FixOrcsWithoutProps"));

            VerifyNoOrphanedFootnotes();
            VerifyResourceForFixedOrphans();
            Assert.AreEqual(2, exodus.FootnotesOS.Count);
        }
Пример #9
0
        public void FixOrcsWithoutProps_OrphanedFootnoteAndValidPicture()
        {
            IScrBook    exodus = CreateExodusData();
            IScrTxtPara para   = AddParaToMockedSectionContent(exodus.SectionsOS[2], ScrStyleNames.NormalParagraph);

            AddVerse(para, 2, 3, "ORC is here, you see, my friend.");

            // Update section 2's paragraph contents to include the picture
            ITsStrBldr    tsStrBldr = para.Contents.GetBldr();
            ITsStrFactory factory   = TsStrFactoryClass.Create();
            string        filename;

            if (MiscUtils.IsUnix)
            {
                filename = "/tmp/junk.jpg";
            }
            else
            {
                filename = "c:\\junk.jpg";
            }
            ICmPicture pict = Cache.ServiceLocator.GetInstance <ICmPictureFactory>().Create(filename,
                                                                                            factory.MakeString("Test picture", Cache.DefaultVernWs), CmFolderTags.LocalPictures);

            Assert.IsNotNull(pict);
            pict.InsertORCAt(tsStrBldr, 11);
            para.Contents = tsStrBldr.GetString();
            // We need a valid footnote after the picture ORC
            CreateFootnote(exodus, 2, para.IndexInOwner, 0, 15, ScrStyleNames.CrossRefFootnoteParagraph, false);

            // Update section 1's paragraph contents to include an orphaned footnote marker
            CreateFootnote(exodus, 1, 0, 0, 19, ScrStyleNames.CrossRefFootnoteParagraph, true);

            TeScrInitializer scrInit = new TestTeScrInitializer(Cache);
            List <string>    report  = (List <string>)ReflectionHelper.GetResult(scrInit, "FixOrcsWithoutProps");

            VerifyNoOrphanedFootnotes();
            VerifyResourceForFixedOrphans();

            Assert.AreEqual(1, report.Count);
            Assert.AreEqual("EXO 1:2 - Deleted corrupted footnote marker or picture anchor", report[0]);

            Assert.AreEqual(1, exodus.FootnotesOS.Count);
        }
Пример #10
0
        public void FixOrcsWithoutProps_OrphanedFootnotesWithNoOrcs()
        {
            IScrBook exodus = CreateExodusData();

            CreateFootnote(exodus, 0, 0, 0, 4, ScrStyleNames.NormalFootnoteParagraph, false);
            IScrFootnote footnote = Cache.ServiceLocator.GetInstance <IScrFootnoteFactory>().Create();

            exodus.FootnotesOS.Add(footnote);
            //IStTxtPara para = (IStTxtPara)footnote.ParagraphsOS.Append(new StTxtPara());
            //para.Contents = TsStringUtils.MakeTss("Poor orphaned footnote 1")

            TeScrInitializer scrInit = new TestTeScrInitializer(Cache);
            List <string>    report  = (List <string>)ReflectionHelper.GetResult(scrInit, "FixOrcsWithoutProps");

            VerifyResourceForFixedOrphans();

            Assert.AreEqual(1, report.Count);
            Assert.AreEqual("EXO - Footnote 2 has no corresponding marker in the vernacular text", report[0]);

            Assert.AreEqual(2, exodus.FootnotesOS.Count);
        }
Пример #11
0
        public void FixOrcsWithoutProps_TwoOrphanedFootnotesInParagraph()
        {
            IScrBook    exodus = CreateExodusData();
            IScrTxtPara para   = AddParaToMockedSectionContent(exodus.SectionsOS[2], ScrStyleNames.NormalParagraph);

            AddVerse(para, 2, 3, "ORC is here, you see, my friend.");
            CreateFootnote(exodus, 1, 0, 0, 7, ScrStyleNames.NormalFootnoteParagraph, true);
            CreateFootnote(exodus, 1, 0, 1, 19, ScrStyleNames.CrossRefFootnoteParagraph, true);

            TeScrInitializer scrInit = new TestTeScrInitializer(Cache);
            List <string>    report  = (List <string>)ReflectionHelper.GetResult(scrInit, "FixOrcsWithoutProps");

            VerifyNoOrphanedFootnotes();
            VerifyResourceForFixedOrphans();

            Assert.AreEqual(2, report.Count);
            Assert.AreEqual("EXO 1:1 - Deleted corrupted footnote marker or picture anchor", report[0]);
            Assert.AreEqual("EXO 1:2 - Deleted corrupted footnote marker or picture anchor", report[1]);

            Assert.AreEqual(0, exodus.FootnotesOS.Count);
        }
Пример #12
0
        public void FixOrcsWithoutProps_OrphanedFootnotesInOrder()
        {
            IScrBook    exodus = CreateExodusData();
            IScrTxtPara para   = AddParaToMockedSectionContent(exodus.SectionsOS[2], ScrStyleNames.NormalParagraph);

            AddVerse(para, 2, 3, "ORC is here, you see, my friend.");
            CreateFootnote(exodus, 0, 0, 0, 4, ScrStyleNames.NormalFootnoteParagraph, false);
            CreateFootnote(exodus, 1, 0, 1, 7, ScrStyleNames.NormalFootnoteParagraph, true);
            CreateFootnote(exodus, 2, 0, 2, 7, ScrStyleNames.CrossRefFootnoteParagraph, false);
            CreateFootnote(exodus, 2, 1, 3, 13, ScrStyleNames.NormalFootnoteParagraph, true);

            TeScrInitializer scrInit = new TestTeScrInitializer(Cache);
            List <string>    report  = (List <string>)ReflectionHelper.GetResult(scrInit, "FixOrcsWithoutProps");

            VerifyNoOrphanedFootnotes();
            VerifyResourceForFixedOrphans();

            Assert.AreEqual(2, report.Count);
            Assert.AreEqual("EXO 1:1 - Connected footnote to marker in the vernacular text", report[0]);
            Assert.AreEqual("EXO 2:3 - Connected footnote to marker in the vernacular text", report[1]);

            Assert.AreEqual(4, exodus.FootnotesOS.Count);
        }
Пример #13
0
		public override void TestTearDown()
		{
			m_scrInitializer = null;

			base.TestTearDown();
		}
Пример #14
0
		/// <summary>
		///
		/// </summary>
		public override void TestSetup()
		{
			base.TestSetup();
			m_scr.ResourcesOC.Clear(); // Make sure we don't think we've already done the fix
			m_scrInitializer = new TestTeScrInitializer(Cache);
		}
Пример #15
0
		public void FixOrcsWithoutProps_OrphanedFootnotesWithNoOrcs()
		{
			IScrBook exodus = CreateExodusData();
			CreateFootnote(exodus, 0, 0, 0, 4, ScrStyleNames.NormalFootnoteParagraph, false);
			IScrFootnote footnote = Cache.ServiceLocator.GetInstance<IScrFootnoteFactory>().Create();
			exodus.FootnotesOS.Add(footnote);
			//IStTxtPara para = (IStTxtPara)footnote.ParagraphsOS.Append(new StTxtPara());
			//para.Contents = TsStringUtils.MakeTss("Poor orphaned footnote 1")

			TeScrInitializer scrInit = new TestTeScrInitializer(Cache);
			List<string> report = (List<string>)ReflectionHelper.GetResult(scrInit, "FixOrcsWithoutProps");

			VerifyResourceForFixedOrphans();

			Assert.AreEqual(1, report.Count);
			Assert.AreEqual("EXO - Footnote 2 has no corresponding marker in the vernacular text", report[0]);

			Assert.AreEqual(2, exodus.FootnotesOS.Count);
		}
Пример #16
0
		public void FixOrcsWithoutProps_OrphanedFootnotesOutOfOrder()
		{
			IScrBook exodus = CreateExodusData();
			CreateFootnote(exodus, 0, 0, 0, 4, ScrStyleNames.NormalFootnoteParagraph, false);
			CreateFootnote(exodus, 1, 0, 1, 7, ScrStyleNames.NormalFootnoteParagraph, true);
			CreateFootnote(exodus, 2, 0, 1 /* this causes this footnote to get inserted before the preceding one*/,
				7, ScrStyleNames.CrossRefFootnoteParagraph, false);
			CreateFootnote(exodus, 2, 0, 3, 14, ScrStyleNames.NormalFootnoteParagraph, true);

			TeScrInitializer scrInit = new TestTeScrInitializer(Cache);
			List<string> report = (List<string>)ReflectionHelper.GetResult(scrInit, "FixOrcsWithoutProps");

			VerifyResourceForFixedOrphans();

			Assert.AreEqual(3, report.Count);
			Assert.AreEqual("EXO 1:1 - Deleted corrupted footnote marker or picture anchor", report[0]);
			// Note that the last ORC gets hooked up to the first orpaned footnote, rather than to
			// its original footnote, leaving the last one as an orphan still.
			Assert.AreEqual("EXO 1:7 - Connected footnote to marker in the vernacular text", report[1]);
			Assert.AreEqual("EXO - Footnote 4 has no corresponding marker in the vernacular text", report[2]);

			Assert.AreEqual(4, exodus.FootnotesOS.Count);
		}
Пример #17
0
		public void FixOrcsWithoutProps_OrphanedFootnotesInTitleIntroAndHeading()
		{
			IScrBook exodus = CreateExodusData();
			CreateFootnote(exodus, exodus.TitleOA, 0, 0, 0, ScrStyleNames.NormalFootnoteParagraph, true);
			CreateFootnote(exodus, 0, 0, 1, 9, ScrStyleNames.NormalFootnoteParagraph, true);
			CreateFootnote(exodus, 1, 0, 2, 7, ScrStyleNames.NormalFootnoteParagraph, false);
			CreateFootnote(exodus, exodus.SectionsOS[2].HeadingOA, 0, 3, 7, ScrStyleNames.NormalFootnoteParagraph, true);
			CreateFootnote(exodus, 2, 0, 4, 13, ScrStyleNames.NormalFootnoteParagraph, false);

			TeScrInitializer scrInit = new TestTeScrInitializer(Cache);
			List<string> report = (List<string>)ReflectionHelper.GetResult(scrInit, "FixOrcsWithoutProps");

			VerifyNoOrphanedFootnotes();
			VerifyResourceForFixedOrphans();

			Assert.AreEqual(3, report.Count);
			Assert.AreEqual("EXO Title - Connected footnote to marker in the vernacular text", report[0]);
			Assert.AreEqual("EXO Intro Section 1, Contents - Connected footnote to marker in the vernacular text", report[1]);
			Assert.AreEqual("EXO 1:6-7 Section Heading - Connected footnote to marker in the vernacular text", report[2]);

			Assert.AreEqual(5, exodus.FootnotesOS.Count);
		}
Пример #18
0
		public void FixOrcsWithoutProps_OrcForMissingObject()
		{
			IScrBook exodus = CreateExodusData();
			IScrTxtPara para = AddParaToMockedSectionContent(exodus.SectionsOS[2], ScrStyleNames.NormalParagraph);
			AddVerse(para, 2, 3, "ORC is here, you see, my friend.");

			// Update the paragraph contents to include the picture
			ITsStrBldr tsStrBldr = para.Contents.GetBldr();
			ITsStrFactory factory = TsStrFactoryClass.Create();
			TsStringUtils.InsertOrcIntoPara(Guid.NewGuid(), FwObjDataTypes.kodtOwnNameGuidHot,
				tsStrBldr, 11, 11, Cache.DefaultVernWs);
			para.Contents = tsStrBldr.GetString();

			TeScrInitializer scrInit = new TestTeScrInitializer(Cache);
			List<string> report = (List<string>)ReflectionHelper.GetResult(scrInit, "FixOrcsWithoutProps");

			VerifyNoOrphanedFootnotes();
			VerifyResourceForFixedOrphans();

			Assert.AreEqual(1, report.Count);
			Assert.AreEqual("EXO 2:3 - Deleted corrupted footnote marker or picture anchor", report[0]);

			Assert.AreEqual(0, exodus.FootnotesOS.Count);
		}
Пример #19
0
		public void FixOrcsWithoutProps_AllFootnotesAreOkay()
		{
			IScrBook exodus = CreateExodusData();
			CreateFootnote(exodus, 0, 0, 0, 4, ScrStyleNames.NormalFootnoteParagraph, false);
			CreateFootnote(exodus, 2, 0, 1, 7, ScrStyleNames.NormalFootnoteParagraph, false);

			TeScrInitializer scrInit = new TestTeScrInitializer(Cache);
			Assert.IsNull(ReflectionHelper.GetResult(scrInit, "FixOrcsWithoutProps"));

			VerifyNoOrphanedFootnotes();
			VerifyResourceForFixedOrphans();
			Assert.AreEqual(2, exodus.FootnotesOS.Count);
		}
Пример #20
0
		public void FixOrcsWithoutProps_NoFootnotesInProject()
		{
			IScrBook exodus = CreateExodusData();

			TeScrInitializer scrInit = new TestTeScrInitializer(Cache);
			Assert.IsNull(ReflectionHelper.GetResult(scrInit, "FixOrcsWithoutProps"));

			VerifyNoOrphanedFootnotes();
			VerifyResourceForFixedOrphans();
			Assert.AreEqual(0, exodus.FootnotesOS.Count);
		}
Пример #21
0
        public override void TestTearDown()
        {
            m_scrInitializer = null;

            base.TestTearDown();
        }
Пример #22
0
 /// <summary>
 ///
 /// </summary>
 public override void TestSetup()
 {
     base.TestSetup();
     m_scr.ResourcesOC.Clear();             // Make sure we don't think we've already done the fix
     m_scrInitializer = new TestTeScrInitializer(Cache);
 }
Пример #23
0
		public override void Exit()
		{
			CheckDisposed();

			m_scrInitializer = null;

			base.Exit();
		}
Пример #24
0
		public void FixOrcsWithoutProps_OrphanedFootnoteAndValidPicture()
		{
			IScrBook exodus = CreateExodusData();
			IScrTxtPara para = AddParaToMockedSectionContent(exodus.SectionsOS[2], ScrStyleNames.NormalParagraph);
			AddVerse(para, 2, 3, "ORC is here, you see, my friend.");

			// Update section 2's paragraph contents to include the picture
			ITsStrBldr tsStrBldr = para.Contents.GetBldr();
			ITsStrFactory factory = TsStrFactoryClass.Create();
			string filename;
			if (MiscUtils.IsUnix)
				filename = "/tmp/junk.jpg";
			else
				filename = "c:\\junk.jpg";
			ICmPicture pict = Cache.ServiceLocator.GetInstance<ICmPictureFactory>().Create(filename,
				factory.MakeString("Test picture", Cache.DefaultVernWs), CmFolderTags.LocalPictures);
			Assert.IsNotNull(pict);
			pict.InsertORCAt(tsStrBldr, 11);
			para.Contents = tsStrBldr.GetString();
			// We need a valid footnote after the picture ORC
			CreateFootnote(exodus, 2, para.IndexInOwner, 0, 15, ScrStyleNames.CrossRefFootnoteParagraph, false);

			// Update section 1's paragraph contents to include an orphaned footnote marker
			CreateFootnote(exodus, 1, 0, 0, 19, ScrStyleNames.CrossRefFootnoteParagraph, true);

			TeScrInitializer scrInit = new TestTeScrInitializer(Cache);
			List<string> report = (List<string>)ReflectionHelper.GetResult(scrInit, "FixOrcsWithoutProps");

			VerifyNoOrphanedFootnotes();
			VerifyResourceForFixedOrphans();

			Assert.AreEqual(1, report.Count);
			Assert.AreEqual("EXO 1:2 - Deleted corrupted footnote marker or picture anchor", report[0]);

			Assert.AreEqual(1, exodus.FootnotesOS.Count);
		}
Пример #25
0
		public void FixOrcsWithoutProps_OrphanedFootnotesInOrder()
		{
			IScrBook exodus = CreateExodusData();
			IScrTxtPara para = AddParaToMockedSectionContent(exodus.SectionsOS[2], ScrStyleNames.NormalParagraph);
			AddVerse(para, 2, 3, "ORC is here, you see, my friend.");
			CreateFootnote(exodus, 0, 0, 0, 4, ScrStyleNames.NormalFootnoteParagraph, false);
			CreateFootnote(exodus, 1, 0, 1, 7, ScrStyleNames.NormalFootnoteParagraph, true);
			CreateFootnote(exodus, 2, 0, 2, 7, ScrStyleNames.CrossRefFootnoteParagraph, false);
			CreateFootnote(exodus, 2, 1, 3, 13, ScrStyleNames.NormalFootnoteParagraph, true);

			TeScrInitializer scrInit = new TestTeScrInitializer(Cache);
			List <string> report = (List<string>)ReflectionHelper.GetResult(scrInit, "FixOrcsWithoutProps");

			VerifyNoOrphanedFootnotes();
			VerifyResourceForFixedOrphans();

			Assert.AreEqual(2, report.Count);
			Assert.AreEqual("EXO 1:1 - Connected footnote to marker in the vernacular text", report[0]);
			Assert.AreEqual("EXO 2:3 - Connected footnote to marker in the vernacular text", report[1]);

			Assert.AreEqual(4, exodus.FootnotesOS.Count);
		}
Пример #26
0
		public void FixOrcsWithoutProps_OrphanedFootnoteAndValidPicture()
		{
			CheckDisposed();

			IScrBook exodus = CreateExodusData();
			StTxtPara para = AddPara(exodus.SectionsOS[2]);
			AddVerse(para, 2, 3, "ORC is here, you see, my friend.");

			// Update the paragraph contents to include the picture
			ITsStrBldr tsStrBldr = para.Contents.UnderlyingTsString.GetBldr();
			ITsStrFactory factory = TsStrFactoryClass.Create();
			CmPicture pict = new CmPicture(Cache, "c:\\junk.jpg",
				factory.MakeString("Test picture", Cache.DefaultVernWs),
				StringUtils.LocalPictures);
			Assert.IsNotNull(pict);
			pict.InsertOwningORCIntoPara(tsStrBldr, 11, 0);
			para.Contents.UnderlyingTsString = tsStrBldr.GetString();

			// Update the paragraph contents to include the (orphaned) footnote marker
			CreateFootnote(exodus, 1, 0, 1, 19, ScrStyleNames.CrossRefFootnoteParagraph, true);

			TeScrInitializer scrInit = new TestTeScrInitializer(Cache);
			List<string> report = (List<string>)ReflectionHelper.GetResult(scrInit, "FixOrcsWithoutProps");

			VerifyNoOrphanedFootnotes();
			VerifyResourceForFixedOrphans();

			Assert.AreEqual(1, report.Count);
			Assert.AreEqual("EXO 1:2 - Deleted corrupted footnote marker or picture anchor", report[0]);

			Assert.AreEqual(0, exodus.FootnotesOS.Count);
		}
Пример #27
0
		public void FixOrcsWithoutProps_TwoOrphanedFootnotesInParagraph()
		{
			IScrBook exodus = CreateExodusData();
			IScrTxtPara para = AddParaToMockedSectionContent(exodus.SectionsOS[2], ScrStyleNames.NormalParagraph);
			AddVerse(para, 2, 3, "ORC is here, you see, my friend.");
			CreateFootnote(exodus, 1, 0, 0, 7, ScrStyleNames.NormalFootnoteParagraph, true);
			CreateFootnote(exodus, 1, 0, 1, 19, ScrStyleNames.CrossRefFootnoteParagraph, true);

			TeScrInitializer scrInit = new TestTeScrInitializer(Cache);
			List<string> report = (List<string>)ReflectionHelper.GetResult(scrInit, "FixOrcsWithoutProps");

			VerifyNoOrphanedFootnotes();
			VerifyResourceForFixedOrphans();

			Assert.AreEqual(2, report.Count);
			Assert.AreEqual("EXO 1:1 - Deleted corrupted footnote marker or picture anchor", report[0]);
			Assert.AreEqual("EXO 1:2 - Deleted corrupted footnote marker or picture anchor", report[1]);

			Assert.AreEqual(0, exodus.FootnotesOS.Count);
		}
Пример #28
0
		public override void Initialize()
		{
			CheckDisposed();
			base.Initialize();

			m_scrInitializer = new TestTeScrInitializer(Cache);
		}