예제 #1
0
        public void EnsureDuplicateContainerFunctionReturnTrue()
        {
            EdmModel model = new EdmModel();
            var edmFunction = new EdmFunction("n.s", "GetStuff", EdmCoreModel.Instance.GetString(true), false /*isBound*/, null /*entitySetPath*/, false /*isComposable*/);
            model.AddElement(edmFunction);

            EdmModel otherModel = new EdmModel();
            EdmEntityContainer container = new EdmEntityContainer("n.s", "GetStuff");
            otherModel.AddElement(container);
            model.AddReferencedModel(otherModel);

            model.OperationOrNameExistsInReferencedModel(edmFunction, edmFunction.FullName()).Should().BeTrue();
        }
예제 #2
0
        public void EnsureNoDuplicateFoundForFunctionShouldReturnFalse()
        {
            EdmModel otherModel = new EdmModel();
            var entityType = new EdmEntityType("n.s", "GetStuff2");
            otherModel.AddElement(entityType);

            var edmFunction = new EdmFunction("n.s", "GetStuff", new EdmEntityTypeReference(entityType, false), false /*isBound*/, null /*entitySetPath*/, false /*isComposable*/);
            EdmModel model = new EdmModel();
            model.AddElement(edmFunction);
            model.AddReferencedModel(otherModel);

            model.OperationOrNameExistsInReferencedModel(edmFunction, edmFunction.FullName()).Should().BeFalse();
        }
예제 #3
0
        public void EnsureDuplicateTermAndFunctionReturnTrue()
        {
            EdmModel model = new EdmModel();
            var edmFunction = new EdmFunction("n.s", "GetStuff", EdmCoreModel.Instance.GetString(true), false /*isBound*/, null /*entitySetPath*/, false /*isComposable*/);
            model.AddElement(edmFunction);

            EdmModel otherModel = new EdmModel();
            var edmTerm = new EdmTerm("n.s", "GetStuff", EdmPrimitiveTypeKind.Int32);
            otherModel.AddElement(edmTerm);
            model.AddReferencedModel(otherModel);

            model.OperationOrNameExistsInReferencedModel(edmFunction, edmFunction.FullName()).Should().BeTrue();
        }