Пример #1
0
        public void ValidatePart(OpenXmlPart part)
        {
            var data = GetConstraintData(part);

            Assert.Same(part.GetPartConstraint(), part.GetPartConstraint());
            Assert.Same(part.GetDataPartReferenceConstraint(), part.GetDataPartReferenceConstraint());

            Assert.Equal(data.IsContentTypeFixed, part.IsContentTypeFixed);
            Assert.Equal(data.RelationshipType, part.RelationshipType);
            Assert.Equal(data.TargetFileExtension, part.TargetFileExtension);
            Assert.Equal(data.TargetName, part.TargetName);
            Assert.Equal(data.TargetPath, part.TargetPath);

            if (part.IsContentTypeFixed)
            {
                Assert.Equal(data.ContentType, part.ContentType);
            }

            AssertDictionary(data.DataParts, part.GetDataPartReferenceConstraint());
            AssertDictionary(data.Parts, part.GetPartConstraint());
        }