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); }
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); }
public void GetNavigationPropertyFromExpandPathWithMetadataSegmentThrows() { var segment = MetadataSegment.Instance; ODataPath odataPath = new ODataPath(segment); Action uriParserHelpersAction = () => UriEdmHelpers.GetNavigationPropertyFromExpandPath(odataPath); uriParserHelpersAction.Throws <ODataException>( Strings.ExpandItemBinder_TypeSegmentNotFollowedByPath); }