Ejemplo n.º 1
0
        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));
                }
        }
Ejemplo n.º 2
0
        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));
                }
        }
Ejemplo n.º 3
0
        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));
                }
        }