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 ValidateEntitySetPathTypeCastColNavPropertyTypeCastNavPropertyReturnsNoErrors() { ValidationRulesTests.OperationOperationEntitySetPathMustBeValidValidTestModel testModelContainer = new ValidationRulesTests.OperationOperationEntitySetPathMustBeValidValidTestModel(); var returnType = new EdmCollectionTypeReference(new EdmCollectionType(new EdmEntityTypeReference(testModelContainer.T3, false))); EdmFunction function = new EdmFunction("ns", "GetStuff", returnType, true /*isBound*/, new EdmPathExpression("bindingEntity/Bunk.T1/ColP101"), false); function.AddParameter("bindingEntity", new EdmEntityTypeReference(testModelContainer.T2, false)); ValidateNoError(testModelContainer.Model, function); }
public void ValidateEntitySetPathBindingParameterWithEntityCollectionAndValidEntitySetPathSucceeds() { ValidationRulesTests.OperationOperationEntitySetPathMustBeValidValidTestModel testModelContainer = new ValidationRulesTests.OperationOperationEntitySetPathMustBeValidValidTestModel(); EdmFunction function = new EdmFunction("ns", "GetStuff", new EdmEntityTypeReference(testModelContainer.T3, false), true /*isBound*/, new EdmPathExpression("bindingEntity/ColNav/RefNav"), false); function.AddParameter("bindingEntity", new EdmCollectionTypeReference(new EdmCollectionType(new EdmEntityTypeReference(testModelContainer.T3, false)))); ValidateNoError(testModelContainer.Model, function); }
public void ValidateTypeCaseWithDerivedPropertyEntitySetPathReturnsNoErrors() { ValidationRulesTests.OperationOperationEntitySetPathMustBeValidValidTestModel testModelContainer = new ValidationRulesTests.OperationOperationEntitySetPathMustBeValidValidTestModel(); EdmFunction function = new EdmFunction("ns", "GetStuff", new EdmEntityTypeReference(testModelContainer.T3, false), true /*isBound*/, new EdmPathExpression("bindingEntity/Bunk.T1/P101"), false); function.AddParameter("bindingEntity", new EdmEntityTypeReference(testModelContainer.T2, false)); ValidateNoError(testModelContainer.Model, function); }
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 ValidateEntitySetPathBindingParameterWithEntityCollectionAndValidEntitySetPathSucceeds() { ValidationRulesTests.OperationOperationEntitySetPathMustBeValidValidTestModel testModelContainer = new ValidationRulesTests.OperationOperationEntitySetPathMustBeValidValidTestModel(); EdmFunction function = new EdmFunction("ns", "GetStuff", new EdmEntityTypeReference(testModelContainer.T3, false), true /*isBound*/, new EdmPathExpression("bindingEntity/ColNav/RefNav"), false); function.AddParameter("bindingEntity", new EdmCollectionTypeReference(new EdmCollectionType(new EdmEntityTypeReference(testModelContainer.T3, false)))); ValidateNoError(testModelContainer.Model, function); }
public void ValidateEntitySetPathTypeCastColNavPropertyTypeCastNavPropertyReturnsNoErrors() { ValidationRulesTests.OperationOperationEntitySetPathMustBeValidValidTestModel testModelContainer = new ValidationRulesTests.OperationOperationEntitySetPathMustBeValidValidTestModel(); var returnType = new EdmCollectionTypeReference(new EdmCollectionType(new EdmEntityTypeReference(testModelContainer.T3, false))); EdmFunction function = new EdmFunction("ns", "GetStuff", returnType, true /*isBound*/, new EdmPathExpression("bindingEntity/Bunk.T1/ColP101"), false); function.AddParameter("bindingEntity", new EdmEntityTypeReference(testModelContainer.T2, false)); ValidateNoError(testModelContainer.Model, function); }
public void ValidateTypeCaseWithDerivedPropertyEntitySetPathReturnsNoErrors() { ValidationRulesTests.OperationOperationEntitySetPathMustBeValidValidTestModel testModelContainer = new ValidationRulesTests.OperationOperationEntitySetPathMustBeValidValidTestModel(); EdmFunction function = new EdmFunction("ns", "GetStuff", new EdmEntityTypeReference(testModelContainer.T3, false), true /*isBound*/, new EdmPathExpression("bindingEntity/Bunk.T1/P101"), false); function.AddParameter("bindingEntity", new EdmEntityTypeReference(testModelContainer.T2, false)); ValidateNoError(testModelContainer.Model, function); }