public void ValidateEntitySetPathNavPropertyUnknownTypeCastShouldError() { ValidationRulesTests.OperationOperationEntitySetPathMustBeValidValidTestModel testModelContainer = new ValidationRulesTests.OperationOperationEntitySetPathMustBeValidValidTestModel(); EdmFunction function = new EdmFunction("ns", "GetStuff", new EdmEntityTypeReference(testModelContainer.T3, false), true /*isBound*/, new EdmPathExpression("bindingEntity/Nav1/Bunk.T1Foo"), false); function.AddParameter("bindingEntity", new EdmEntityTypeReference(testModelContainer.T3, false)); ValidateErrorInList( testModelContainer.Model, function, EdmErrorCode.InvalidPathUnknownTypeCastSegment, Strings.EdmModel_Validator_Semantic_InvalidEntitySetPathUnknownTypeCastSegment("EntitySetPath", "bindingEntity/Nav1/Bunk.T1Foo", "Bunk.T1Foo")); }
public void EdmPathExpressionWithUnknownTypeCastSegmentShouldError() { EdmEntityType entityType = new EdmEntityType("ds.s", "entityType"); EdmModel model = new EdmModel(); model.AddElement(entityType); EdmFunction function = new EdmFunction("ns", "GetStuff", DefaultValidEntityTypeRef, true /*isBound*/, new EdmPathExpression("bindingEntity/unknown.EntityType"), false); function.AddParameter("bindingEntity", new EdmEntityTypeReference(entityType, false)); model.AddElement(function); ValidateErrorInList( model, function, EdmErrorCode.InvalidPathUnknownTypeCastSegment, Strings.EdmModel_Validator_Semantic_InvalidEntitySetPathUnknownTypeCastSegment("EntitySetPath", "bindingEntity/unknown.EntityType", "unknown.EntityType")); }