public void ExportFootnote_Missing()
        {
            int markerStyleNumber =
                m_styleSheet.FindStyle(ScrStyleNames.FootnoteMarker).IndexInOwner + 1;
            int footnoteStyleNumber =
                m_styleSheet.FindStyle(ScrStyleNames.NormalFootnoteParagraph).IndexInOwner + 1;

            ITsStrFactory stringFactory = TsStrFactoryClass.Create();

            // Create a book with a section that has a paragraph with some text and a footnote!
            AddRunToMockedPara(m_para, "My text for footnotes", string.Empty);
            IStFootnote testFootnote = AddFootnote(m_book, m_para, m_para.Contents.Length, string.Empty);

            m_exporter = new DummyExportRtf(m_fileName, Cache, m_styleSheet);
            m_exporter.CallExportParagraph(m_para);

            // Verify the contents of the temp file
            m_exporter.CloseOutputFile();
            using (TextReader file = FileUtils.OpenFileForRead(m_fileName, Encoding.ASCII))
            {
                string line = file.ReadLine();

                // the line is the paragraph without the footnote marker.
                Assert.AreEqual(@"\pard\plain\s2\f1\fs20{My text for footnotes}", line);
            }
        }
Esempio n. 2
0
		public void ExportFootnote_Missing()
		{
			int markerStyleNumber =
				m_styleSheet.FindStyle(ScrStyleNames.FootnoteMarker).IndexInOwner + 1;
			int footnoteStyleNumber =
				m_styleSheet.FindStyle(ScrStyleNames.NormalFootnoteParagraph).IndexInOwner + 1;

			ITsStrFactory stringFactory = TsStrFactoryClass.Create();

			// Create a book with a section that has a paragraph with some text and a footnote!
			AddRunToMockedPara(m_para, "My text for footnotes", string.Empty);
			IStFootnote testFootnote = AddFootnote(m_book, m_para, m_para.Contents.Length, string.Empty);

			m_exporter = new DummyExportRtf(m_fileName, Cache, m_styleSheet);
			m_exporter.CallExportParagraph(m_para);

			// Verify the contents of the temp file
			m_exporter.CloseOutputFile();
			using (TextReader file = FileUtils.OpenFileForRead(m_fileName, Encoding.ASCII))
			{
				string line = file.ReadLine();

				// the line is the paragraph without the footnote marker.
				Assert.AreEqual(@"\pard\plain\s2\f1\fs20{My text for footnotes}", line);
			}
		}