Ejemplo n.º 1
0
        public void GetDefaultValue_NonNullableEntity()
        {
            IEdmTypeReference nonNullableEntityType = new EdmEntityTypeReference(new EdmEntityType("NS", "Entity"), isNullable: false);

            var result = EdmStructuredObject.GetDefaultValue(nonNullableEntityType);

            var entityObject = Assert.IsType <EdmEntityObject>(result);

            Assert.Equal(nonNullableEntityType, entityObject.GetEdmType(), new EdmTypeReferenceEqualityComparer());
        }
Ejemplo n.º 2
0
        public void GetDefaultValue_NonNullableEntityCollection()
        {
            IEdmTypeReference           elementType          = new EdmEntityTypeReference(new EdmEntityType("NS", "Entity"), isNullable: true);
            IEdmCollectionTypeReference entityCollectionType = new EdmCollectionTypeReference(new EdmCollectionType(elementType));

            var result = EdmStructuredObject.GetDefaultValue(entityCollectionType);

            var entityCollectionObject = Assert.IsType <EdmEntityObjectCollection>(result);

            Assert.Equal(entityCollectionType, entityCollectionObject.GetEdmType(), new EdmTypeReferenceEqualityComparer());
        }
Ejemplo n.º 3
0
 public void GetDefaultValue(IEdmTypeReference edmType, object expectedResult)
 {
     Assert.Equal(expectedResult, EdmStructuredObject.GetDefaultValue(edmType));
 }