public void ReplaceSingleTagWithTextBlocksDoesNothing() { using (var initialDocument = new DocxDocument(Resources.WithMainContentSingleTag)) { var content = new[] { new TextBlock("Контент документа") }; initialDocument.Replace("MAIN_CONTENT", content); Assert.IsTrue(new DocxDocumentEqualityComparer().Equals(initialDocument, initialDocument)); } }
public void ReplaceOpenCloseTagWithTextBlocksEditable() { using (var initialDocument = new DocxDocument(Resources.WithMainContentTag)) using (var expectedDocument = new DocxDocument(Resources.WithMainContentInserted)) { var content = new[] { new TextBlock("Контент документа") }; initialDocument.Replace("MAIN_CONTENT", content); Assert.IsTrue(new DocxDocumentEqualityComparer().Equals(expectedDocument, initialDocument)); } }
public void ReplacePairsFromDictionary() { using (var initialDocument = new DocxDocument(Resources.DocumentWithTitle)) using (var expectedDocument = new DocxDocument(Resources.DocumentWithReplacedTitle)) { initialDocument.Replace(new Dictionary <string, string> { { "Title", "Hello" } }); Assert.IsTrue(new DocxDocumentEqualityComparer().Equals(expectedDocument, initialDocument)); } }