Exemplo n.º 1
0
        public void GetEdmType_ReturnsCastType_IfPreviousTypeIsNotCollection()
        {
            // Arrange
            EdmEntityType castType = new EdmEntityType("NS", "Entity");
            EdmEntityType previousEdmType = new EdmEntityType("NS", "PreviousType");
            CastPathSegment castSegment = new CastPathSegment(castType);

            // Act
            var result = castSegment.GetEdmType(previousEdmType);

            // Assert
            Assert.Equal(castType, result);
        }
Exemplo n.º 2
0
        public void GetEdmType_ReturnsCastType_IfPreviousTypeIsNotCollection()
        {
            // Arrange
            EdmEntityType   castType        = new EdmEntityType("NS", "Entity");
            EdmEntityType   previousEdmType = new EdmEntityType("NS", "PreviousType");
            CastPathSegment castSegment     = new CastPathSegment(castType);

            // Act
            var result = castSegment.GetEdmType(previousEdmType);

            // Assert
            Assert.Equal(castType, result);
        }
Exemplo n.º 3
0
        public void GetEdmType_ReturnsCollectionCastType_IfPreviousTypeIsCollection()
        {
            // Arrange
            EdmEntityType castType = new EdmEntityType("NS", "Entity");
            EdmCollectionType previousEdmType = new EdmCollectionType(new EdmEntityType("NS", "PreviousType").AsReference());
            CastPathSegment castSegment = new CastPathSegment(castType);

            // Act
            var result = castSegment.GetEdmType(previousEdmType);

            // Assert
            Assert.Equal(EdmTypeKind.Collection, result.TypeKind);
            Assert.Equal(castType, (result as IEdmCollectionType).ElementType.Definition);
        }
Exemplo n.º 4
0
        public void GetEdmType_ReturnsCollectionCastType_IfPreviousTypeIsCollection()
        {
            // Arrange
            EdmEntityType     castType        = new EdmEntityType("NS", "Entity");
            EdmCollectionType previousEdmType = new EdmCollectionType(new EdmEntityType("NS", "PreviousType").AsReference());
            CastPathSegment   castSegment     = new CastPathSegment(castType);

            // Act
            var result = castSegment.GetEdmType(previousEdmType);

            // Assert
            Assert.Equal(EdmTypeKind.Collection, result.TypeKind);
            Assert.Equal(castType, (result as IEdmCollectionType).ElementType.Definition);
        }