Example #1
0
        public void IsComplexOrCollectionComplex_TestNullInputCorrect()
        {
            // Arrange & Act
            IEdmStructuralProperty primitiveProperty = null;

            // Assert
            Assert.False(SelectExpandNode.IsComplexOrCollectionComplex(primitiveProperty));
        }
Example #2
0
        public void IsComplexOrCollectionComplex_TestPrimitiveStructuralPropertyCorrect(bool isCollection)
        {
            // Arrange & Act
            var                    stringType = EdmCoreModel.Instance.GetString(false);
            EdmEntityType          entityType = new EdmEntityType("NS", "Entity");
            IEdmStructuralProperty primitiveProperty;

            if (isCollection)
            {
                primitiveProperty = entityType.AddStructuralProperty("Codes", new EdmCollectionTypeReference(new EdmCollectionType(stringType)));
            }
            else
            {
                primitiveProperty = entityType.AddStructuralProperty("Id", stringType);
            }

            // Assert
            Assert.False(SelectExpandNode.IsComplexOrCollectionComplex(primitiveProperty));
        }
Example #3
0
        public void IsComplexOrCollectionComplex_TestComplexStructuralPropertyCorrect(bool isCollection)
        {
            // Arrange & Act
            var           complexType = new EdmComplexTypeReference(new EdmComplexType("NS", "Complex"), false);
            EdmEntityType entityType  = new EdmEntityType("NS", "Entity");

            IEdmStructuralProperty complexProperty;

            if (isCollection)
            {
                complexProperty = entityType.AddStructuralProperty("Complexes", new EdmCollectionTypeReference(new EdmCollectionType(complexType)));
            }
            else
            {
                complexProperty = entityType.AddStructuralProperty("Single", complexType);
            }

            // Assert
            Assert.True(SelectExpandNode.IsComplexOrCollectionComplex(complexProperty));
        }