Example #1
0
        public void DocumentMarkerGetCrossedParagraphElementsShouldReturnNone()
        {
            IList <int> result = UniversalDocNoParagraphIdMarker.GetCrossedParagraphElements(WordDocumentPartAttributes.GetParagraphNoIdFormatter(4), WordDocumentPartAttributes.GetParagraphNoIdFormatter(1));

            Assert.IsNotNull(result);
            Assert.AreEqual(0, result.Count);
        }
Example #2
0
 public void WordGetMethodShouldHaveCorrectElementsNoParagraphId()
 {
     Assert.AreEqual(WordDocumentPartAttributes.GetParagraphNoIdFormatter(10), PartsSelectionElementsNoParagraphId[10].ElementId);
     Assert.AreEqual(WordDocumentPartAttributes.GetParagraphNoIdFormatter(100), PartsSelectionElementsNoParagraphId[100].ElementId);
     Assert.AreEqual(WordDocumentPartAttributes.GetParagraphNoIdFormatter(200), PartsSelectionElementsNoParagraphId[200].ElementId);
 }
Example #3
0
        private string GetParagraphId(OpenXmlElement element)
        {
            string result = string.Empty;

            if (element is Paragraph)
            {
                Paragraph parahraph = (element as Paragraph);
                int       index     = ElementsList.FindIndex(el => el.Equals(element));
                result = parahraph.ParagraphId != null ? parahraph.ParagraphId.Value : WordDocumentPartAttributes.GetParagraphNoIdFormatter(index);
            }

            return(result);
        }