public InlineField ( string fieldName, Action |
||
fieldName | string | |
options | Action |
|
return | IDocumentBuilder |
public void PropertiesAppliedToInlineFieldInHeadersAndFooters() { using (var expected = new DocxDocument(Resources.FieldsInHeadersAndFootersReplaced)) using (var document = new DocxDocument(Resources.FieldsInHeadersAndFooters)) { var builder = new DocxDocumentBuilder(document); builder.InlineField("Signer.ShortNameThisOrSubstitute", x => x.Text("Первый").Text("Второй")); Assert.IsTrue(new DocxDocumentEqualityComparer().Equals(expected, document)); } }
public void PropertiesAppliedToInlineFieldShouldPersistAfterSettingContent() { using (var expected = new DocxDocument(Resources.WithStyledInlineSdtElementContentInserted)) using (var document = new DocxDocument(Resources.WithStyledInlineSdtElement)) { var builder = new DocxDocumentBuilder(document); builder.InlineField("InlineField", x => x.Text("Первый").Text("Второй")); Assert.IsTrue(new DocxDocumentEqualityComparer().Equals(expected, document)); } }
public void CanSetContentToInlineFieldConsistingOfTwoRuns() { using (var expected = new DocxDocument(Resources.WithTwoRunsInInlineField)) using (var document = new DocxDocument(Resources.WithSdtElements)) { var builder = new DocxDocumentBuilder(document); builder.InlineField("InlineField", x => x.Text("Первый").Text("Второй")); Assert.IsTrue(new DocxDocumentEqualityComparer().Equals(expected, document)); } }