Exemple #1
0
        private void Bug662650(OpenXmlValidator validator)
        {
            DocumentFormat.OpenXml.Wordprocessing.StylePaneSortMethods spsm = new StylePaneSortMethods();
            spsm.Val       = new StringValue();
            spsm.Val.Value = "aaaaaa";

            var errors = validator.Validate(spsm);

            Assert.Single(errors);
            Assert.Equal(ValidationErrorType.Schema, errors.First().ErrorType);
            Assert.Equal("Sch_AttributeValueDataTypeDetailed", errors.First().Id);
        }
Exemple #2
0
        public void Bug662650(FileFormatVersions version)
        {
            var validator = new OpenXmlValidator(version);

            DocumentFormat.OpenXml.Wordprocessing.StylePaneSortMethods spsm = new StylePaneSortMethods();
            spsm.Val       = new StringValue();
            spsm.Val.Value = "aaaaaa";

            var errors = validator.Validate(spsm);

            Assert.Collection(errors, e =>
            {
                Assert.Equal("The attribute 'http://schemas.openxmlformats.org/wordprocessingml/2006/main:val' has invalid value 'aaaaaa'. The Enumeration constraint failed.", e.Description);
                Assert.Same(spsm, e.Node);
                Assert.Null(e.RelatedNode);
                Assert.Equal(ValidationErrorType.Schema, e.ErrorType);
                Assert.Equal("Sch_AttributeValueDataTypeDetailed", e.Id);
                Assert.Equal("/w:stylePaneSortMethod[1]", e.Path.XPath);
            });
        }
        private void Bug662650(OpenXmlValidator validator)
        {
            DocumentFormat.OpenXml.Wordprocessing.StylePaneSortMethods spsm = new StylePaneSortMethods();
            spsm.Val = new StringValue();
            spsm.Val.Value = "aaaaaa";

            var errors = validator.Validate(spsm);
            Assert.Equal(1, errors.Count());
            Assert.Equal(ValidationErrorType.Schema, errors.First().ErrorType);
            Assert.Equal("Sch_AttributeValueDataTypeDetailed", errors.First().Id);
        }