Пример #1
0
        public void TestInterfaceCriticalPropertyValueMustNotBeNullUsingOperationParameterDeclaredTypeModel()
        {
            var expectedErrors = new EdmLibTestErrors()
            {
                { null, null, EdmErrorCode.InterfaceCriticalPropertyValueMustNotBeNull }
            };

            var model = InterfaceCriticalModelBuilder.InterfaceCriticalPropertyValueMustNotBeNullUsingOperationParameterDeclaredTypeModel();

            this.ValidateUsingEdmValidator(model, expectedErrors);
            this.ValidateUsingEdmValidator(model, EdmConstants.EdmVersion4, expectedErrors);
            this.ValidateUsingEdmValidator(model, ValidationRuleSet.GetEdmModelRuleSet(EdmConstants.EdmVersion4), expectedErrors);
        }
Пример #2
0
        public void TestEdmExpressionKindInterfaceCriticalKindValueUnexpectedOnlyModel()
        {
            var expectedErrors = new EdmLibTestErrors()
            {
                { null, null, EdmErrorCode.InterfaceCriticalKindValueUnexpected }
            };

            var model = InterfaceCriticalModelBuilder.EdmExpressionKindInterfaceCriticalKindValueUnexpectedOnlyModel();

            this.ValidateUsingEdmValidator(model, expectedErrors);
            this.ValidateUsingEdmValidator(model, EdmConstants.EdmVersion4, expectedErrors);
            this.ValidateUsingEdmValidator(model, ValidationRuleSet.GetEdmModelRuleSet(EdmConstants.EdmVersion4), expectedErrors);
        }
Пример #3
0
        public void TestInterfaceCriticalEnumerableMustNotHaveNullElementsOnlyModel()
        {
            var expectedErrors = new EdmLibTestErrors()
            {
                { null, null, EdmErrorCode.InterfaceCriticalEnumerableMustNotHaveNullElements }
            };

            var model = InterfaceCriticalModelBuilder.InterfaceCriticalEnumerableMustNotHaveNullElementsOnlyModel();

            this.ValidateUsingEdmValidator(model, expectedErrors);
            this.ValidateUsingEdmValidator(model, EdmConstants.EdmVersion4, expectedErrors);
            this.ValidateUsingEdmValidator(model, ValidationRuleSet.GetEdmModelRuleSet(EdmConstants.EdmVersion4), expectedErrors);
        }
Пример #4
0
        public void TestInterfaceCriticalKindValueMismatchOnlyUsingEnumTypeReferenceModel()
        {
            var expectedErrors = new EdmLibTestErrors()
            {
                { null, null, EdmErrorCode.InterfaceCriticalKindValueMismatch }
            };

            var model = InterfaceCriticalModelBuilder.InterfaceCriticalKindValueMismatchOnlyUsingEnumTypeReferenceModel();

            this.ValidateUsingEdmValidator(model, expectedErrors);
            this.ValidateUsingEdmValidator(model, EdmConstants.EdmVersion4, expectedErrors);
            this.ValidateUsingEdmValidator(model, ValidationRuleSet.GetEdmModelRuleSet(EdmConstants.EdmVersion4), expectedErrors);
        }
Пример #5
0
        public void TestInterfaceCriticalPropertyValueMustNotBeNullCsdl()
        {
            var expectedErrors = new EdmLibTestErrors()
            {
                { null, null, EdmErrorCode.InterfaceCriticalPropertyValueMustNotBeNull }
            };

            var csdls = InterfaceCriticalModelBuilder.InterfaceCriticalPropertyValueMustNotBeNullOnlyCsdl();
            var model = this.GetParserResult(csdls);

            this.ValidateUsingEdmValidator(model, expectedErrors);
            this.ValidateUsingEdmValidator(model, EdmConstants.EdmVersion4, expectedErrors);
            this.ValidateUsingEdmValidator(model, ValidationRuleSet.GetEdmModelRuleSet(EdmConstants.EdmVersion4), expectedErrors);
        }
Пример #6
0
        public void TestInterfaceCriticalNavigationPartnerInvalidOnlyCsdl()
        {
            var expectedErrors = new EdmLibTestErrors()
            {
                { null, null, EdmErrorCode.InterfaceCriticalNavigationPartnerInvalid },
                { null, null, EdmErrorCode.BadUnresolvedNavigationPropertyPath }
            };

            var csdls = InterfaceCriticalModelBuilder.InterfaceCriticalNavigationPartnerInvalidOnlyCsdl();
            var model = this.GetParserResult(csdls);

            this.ValidateUsingEdmValidator(model, expectedErrors);
            this.ValidateUsingEdmValidator(model, ValidationRuleSet.GetEdmModelRuleSet(EdmConstants.EdmVersion4), expectedErrors);
            this.ValidateUsingEdmValidator(model, EdmConstants.EdmVersion4, expectedErrors);
        }
Пример #7
0
        public void TestElementInterfaceCriticalKindValueUnexpected()
        {
            var expectedErrors = new EdmLibTestErrors()
            {
                { null, null, EdmErrorCode.InterfaceCriticalKindValueUnexpected }
            };

            var model = InterfaceCriticalModelBuilder.EdmTypeKindInterfaceCriticalKindValueUnexpectedOnlyModel();

            this.ValidateElement(model, expectedErrors);

            var entity = model.SchemaElements.OfType <IEdmEntityType>().ElementAt(0);

            this.ValidateElement(entity, expectedErrors);
        }
Пример #8
0
        public void TestAllInterfaceCriticalModel()
        {
            var expectedErrors = new EdmLibTestErrors()
            {
                { null, null, EdmErrorCode.InterfaceCriticalEnumerableMustNotHaveNullElements },
                { null, null, EdmErrorCode.InterfaceCriticalKindValueMismatch },
                { null, null, EdmErrorCode.InterfaceCriticalKindValueUnexpected },
                { null, null, EdmErrorCode.InterfaceCriticalNavigationPartnerInvalid },
                { null, null, EdmErrorCode.InterfaceCriticalPropertyValueMustNotBeNull },
                { null, null, EdmErrorCode.InterfaceCriticalPropertyValueMustNotBeNull },
            };

            var model = InterfaceCriticalModelBuilder.AllInterfaceCriticalModel();

            this.ValidateUsingEdmValidator(model, expectedErrors);
            this.ValidateUsingEdmValidator(model, EdmConstants.EdmVersion4, expectedErrors);
            this.ValidateUsingEdmValidator(model, ValidationRuleSet.GetEdmModelRuleSet(EdmConstants.EdmVersion4), expectedErrors);
        }
Пример #9
0
        public void TestElementInterfaceCriticalKindValueMismatch()
        {
            var expectedErrors = new EdmLibTestErrors()
            {
                { null, null, EdmErrorCode.InterfaceCriticalKindValueMismatch }
            };

            var model = InterfaceCriticalModelBuilder.InterfaceCriticalKindValueMismatchOnlyModel();

            this.ValidateElement(model, expectedErrors);

            var valueAnnotation = model.VocabularyAnnotations.OfType <IEdmValueAnnotation>().ElementAt(0);

            this.ValidateElement(valueAnnotation, expectedErrors);

            var annotationValue = valueAnnotation.Value;

            this.ValidateElement(annotationValue, expectedErrors);
        }