private void Bug424104(OpenXmlValidator validator) { // change <xsd:any > to <xsd:any minOccurs=0 in CT_OfficeArtExtension" DocumentFormat.OpenXml.Drawing.Extension ext = new DocumentFormat.OpenXml.Drawing.Extension() { Uri = "test" }; var errors = validator.Validate(ext); Assert.Empty(errors); // CT_Extension in PPT, <xsd:any > without minOccurs var pext = new DocumentFormat.OpenXml.Presentation.Extension(); pext.Uri = "http://www.live.com"; errors = validator.Validate(pext); Assert.Single(errors); Assert.EndsWith("any element in namespace '##any'.", errors.First().Description); }
private void Bug424104(OpenXmlValidator validator) { // // change <xsd:any > to <xsd:any minOccurs=0 in CT_OfficeArtExtension" DocumentFormat.OpenXml.Drawing.Extension ext = new DocumentFormat.OpenXml.Drawing.Extension() { Uri = "test" }; var errors = validator.Validate(ext); Assert.Equal(0, errors.Count()); // CT_Extension in PPT, <xsd:any > wihtout minOccurs var pext = new DocumentFormat.OpenXml.Presentation.Extension(); pext.Uri = "http://www.live.com"; errors = validator.Validate(pext); Assert.Equal(1, errors.Count()); Assert.True(errors.First().Description.EndsWith("any element in namespace '##any'.")); }