public void SetCustomPropertyToDocumentIfItAlreadyHasProperties()
        {
            using (var withTwoAttributes = new DocxDocument(Resources.DocumentWithTwoAttributes))
            using (var withAttribute = new DocxDocument(Resources.DocumentWithAttribute))
            {
                withAttribute.SetCustomProperty("customAttributes2", "Working2");

                DocumentFormat.OpenXml.CustomProperties.Properties propertiesWithTwoAttributes = withTwoAttributes.GetWordDocument().CustomFilePropertiesPart.Properties;
                DocumentFormat.OpenXml.CustomProperties.Properties propertiesWithAttribute = withAttribute.GetWordDocument().CustomFilePropertiesPart.Properties;

                Assert.Equal(propertiesWithTwoAttributes.First(x => x.LocalName == "property").OuterXml,
                             propertiesWithAttribute.First(x => x.LocalName == "property").OuterXml);
                Assert.Equal(propertiesWithTwoAttributes.Last(x => x.LocalName == "property").OuterXml,
                             propertiesWithAttribute.Last(x => x.LocalName == "property").OuterXml);
            }
        }
        public void SetCustomPropertyToDocument()
        {
            using (var withoutAttributes = new DocxDocument(Resources.DocumentWithoutAttributes))
            using (var withAttribute = new DocxDocument(Resources.DocumentWithAttribute))
            {
                withoutAttributes.SetCustomProperty("customAttributes", "Working");

                var withoutAttributesOuterXml = withoutAttributes.GetWordDocument().CustomFilePropertiesPart.Properties.Single(x => x.LocalName == "property").OuterXml;
                var withAttributeOuterXml = withAttribute.GetWordDocument().CustomFilePropertiesPart.Properties.Single(x => x.LocalName == "property").OuterXml;
                Assert.Equal(withAttributeOuterXml, withoutAttributesOuterXml);
            }
        }