Beispiel #1
0
        public void EnumType_returns_type_when_enum_property()
        {
            var enumType = new EnumType();

            var property = EdmProperty.CreateEnum("P", enumType);

            Assert.Same(enumType, property.EnumType);
        }
Beispiel #2
0
        public void IsEnumType_returns_true_when_enum_property()
        {
            var enumType = new EnumType();

            var property = EdmProperty.CreateEnum("P", enumType);

            Assert.False(property.IsComplexType);
            Assert.False(property.IsPrimitiveType);
            Assert.True(property.IsEnumType);
        }
Beispiel #3
0
        public void Enum_should_create_enum_property()
        {
            var enumType = new EnumType();

            var property = EdmProperty.CreateEnum("P", enumType);

            Assert.NotNull(property);
            Assert.NotNull(property.TypeUsage);
            Assert.Same(enumType, property.TypeUsage.EdmType);
        }
Beispiel #4
0
        public void IsUnderlyingPrimitiveType_returns_true_when_underlying_primitive_property()
        {
            var primitiveType = PrimitiveType.GetEdmPrimitiveType(PrimitiveTypeKind.Int32);

            var property = EdmProperty.CreatePrimitive("P", primitiveType);

            Assert.True(property.IsUnderlyingPrimitiveType);

            var enumType = new EnumType();

            property = EdmProperty.CreateEnum("P", enumType);

            Assert.True(property.IsUnderlyingPrimitiveType);
        }
Beispiel #5
0
        public void UnderlyingPrimitiveType_returns_type_when_underlying_primitive_property()
        {
            var primitiveType = PrimitiveType.GetEdmPrimitiveType(PrimitiveTypeKind.Int32);

            var property = EdmProperty.CreatePrimitive("P", primitiveType);

            Assert.Same(primitiveType, property.UnderlyingPrimitiveType);

            var enumType = new EnumType();

            property = EdmProperty.CreateEnum("P", enumType);

            Assert.Same(primitiveType, property.UnderlyingPrimitiveType);

            var complexType = new ComplexType();

            property = EdmProperty.CreateComplex("P", complexType);

            Assert.Null(property.UnderlyingPrimitiveType);
        }