BlockField() 공개 메소드

public BlockField ( string fieldName, Action options ) : IDocumentBuilder
fieldName string
options Action
리턴 IDocumentBuilder
        public void PropertiesAppliedToBlockFieldShouldPersistAfterSettingContent()
        {
            using (var expected = new DocxDocument(Resources.WithStyledSdtElementsContentInserted))
            using (var document = new DocxDocument(Resources.WithStyledSdtElements))
            {
                var builder = new DocxDocumentBuilder(document);

                builder.BlockField("BlockField", x => x.Paragraph("Первый").Paragraph("Второй"));

                Assert.IsTrue(new DocxDocumentEqualityComparer().Equals(expected, document));
            }
        }
        public void CanSetContentToBlockFieldConsistingOfTwoParagraphs()
        {
            using (var expected = new DocxDocument(Resources.WithTwoParagraphsInBlockField))
            using (var document = new DocxDocument(Resources.WithSdtElements))
            {
                var builder = new DocxDocumentBuilder(document);

                builder.BlockField("BlockField", x => x.Paragraph("Первый").Paragraph("Второй"));

                Assert.IsTrue(new DocxDocumentEqualityComparer().Equals(expected, document));
            }
        }