Пример #1
0
        public void GetNavigationPropertyFromExpandPathWithNavigationPropertySegmentReturnNavProperty()
        {
            var       segment   = new NavigationPropertySegment(HardCodedTestModel.GetPersonMyDogNavProp(), null);
            ODataPath odataPath = new ODataPath(segment);
            var       result    = UriEdmHelpers.GetNavigationPropertyFromExpandPath(odataPath);

            Assert.Same(segment.NavigationProperty, result);
        }
Пример #2
0
        public void GetNavigationPropertyFromExpandPathWithTypeSegmentThrows()
        {
            var       segment   = new TypeSegment(HardCodedTestModel.GetHomeAddressType(), null);
            ODataPath odataPath = new ODataPath(segment);
            Action    uriParserHelpersAction = () => UriEdmHelpers.GetNavigationPropertyFromExpandPath(odataPath);

            uriParserHelpersAction.Throws <ODataException>(
                Strings.ExpandItemBinder_TypeSegmentNotFollowedByPath);
        }
Пример #3
0
        public void GetNavigationPropertyFromExpandPathWithMetadataSegmentThrows()
        {
            var       segment   = MetadataSegment.Instance;
            ODataPath odataPath = new ODataPath(segment);
            Action    uriParserHelpersAction = () => UriEdmHelpers.GetNavigationPropertyFromExpandPath(odataPath);

            uriParserHelpersAction.Throws <ODataException>(
                Strings.ExpandItemBinder_TypeSegmentNotFollowedByPath);
        }