public void GetEdmType_ReturnsCastType_IfPreviousTypeIsNotCollection()
        {
            // Arrange
            EdmComplexType castType = new EdmComplexType("NS", "Complex");
            EdmComplexType previousEdmType = new EdmComplexType("NS", "PreviousType");
            ComplexCastPathSegment castSegment = new ComplexCastPathSegment(castType);

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

            // Assert
            Assert.Equal(castType, result);
        }
        public void GetEdmType_ReturnsCastType_IfPreviousTypeIsNotCollection()
        {
            // Arrange
            EdmComplexType         castType        = new EdmComplexType("NS", "Complex");
            EdmComplexType         previousEdmType = new EdmComplexType("NS", "PreviousType");
            ComplexCastPathSegment castSegment     = new ComplexCastPathSegment(castType);

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

            // Assert
            Assert.Equal(castType, result);
        }
        public void GetEdmType_ReturnsCollectionCastType_IfPreviousTypeIsCollection()
        {
            // Arrange
            EdmComplexType castType = new EdmComplexType("NS", "Complex");
            EdmCollectionType previousEdmType =
                new EdmCollectionType(new EdmComplexType("NS", "PreviousType").AsReference());
            ComplexCastPathSegment castSegment = new ComplexCastPathSegment(castType);

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

            // Assert
            Assert.Equal(EdmTypeKind.Collection, result.TypeKind);
            Assert.Equal(castType, (result as IEdmCollectionType).ElementType.Definition);
        }
        public void GetEdmType_ReturnsCollectionCastType_IfPreviousTypeIsCollection()
        {
            // Arrange
            EdmComplexType    castType        = new EdmComplexType("NS", "Complex");
            EdmCollectionType previousEdmType =
                new EdmCollectionType(new EdmComplexType("NS", "PreviousType").AsReference());
            ComplexCastPathSegment castSegment = new ComplexCastPathSegment(castType);

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

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