public void SerializeInlineAnnotationWithInvalidTargetModel() { var actualCsdl = ConvertCsdlsToXElements(@"<Schema Namespace=""Foo"" xmlns=""http://docs.oasis-open.org/odata/ns/edm""> <ComplexType Name=""SimpleType""> <Property Name=""StringValue"" Nullable=""true"" Type=""Edm.String"" /> </ComplexType> <EntityType Name=""SimpleEntity""> <Key> <PropertyRef Name=""Int32Value"" /> </Key> <Property Name=""Int32Value"" Nullable=""false"" Type=""Edm.Int32"" /> </EntityType> <Function Name=""InvalidFunction""> <Parameter Name=""InvalidParameter"" Nullable=""true"" Type=""Edm.Int32""> <Annotation Int=""1"" Term=""Foo.SimpleTerm"" /> </Parameter> <ReturnType Type=""Edm.Int32"" /> <Annotation Int=""1"" Term=""Foo.SimpleTerm"" /> </Function> <Term Name=""ComplexTerm"" Type=""Foo.SimpleType"" /> <Term Name=""SimpleTerm"" Type=""Edm.Int32"" /> <Term Name=""EntityTerm"" Type=""Foo.SimpleEntity"" /> </Schema>"); SerializingValidator(VocabularyTestModelBuilder.AnnotationWithInvalidTargetModel(EdmVocabularyAnnotationSerializationLocation.Inline), actualCsdl); }
public void SerializeOutOfLineAnnotationWithInvalidTargetModel() { IEnumerable <EdmError> actualErrors; var expectedErrors = new EdmLibTestErrors() { { "(Microsoft.OData.Edm.Vocabularies.EdmVocabularyAnnotation)", EdmErrorCode.InvalidName }, { "(Microsoft.OData.Edm.Vocabularies.EdmVocabularyAnnotation)", EdmErrorCode.InvalidName }, { "(Microsoft.OData.Edm.Vocabularies.EdmVocabularyAnnotation)", EdmErrorCode.InvalidName }, { "(Microsoft.OData.Edm.Vocabularies.EdmVocabularyAnnotation)", EdmErrorCode.InvalidName } }; GetSerializerResult(VocabularyTestModelBuilder.AnnotationWithInvalidTargetModel(EdmVocabularyAnnotationSerializationLocation.OutOfLine), out actualErrors); CompareErrors(actualErrors, expectedErrors); }
public void ValidateOutOfLineAnnotationWithInvalidTargetModel() { EdmModel model = VocabularyTestModelBuilder.AnnotationWithInvalidTargetModel(EdmVocabularyAnnotationSerializationLocation.OutOfLine); Assert.AreEqual(9, model.VocabularyAnnotations.Count(), "Invalid count of annotation."); }