public void PathExtensionsToExpandPathWithNavigationPropertyReturnsExpandedPath() { var property = mbh.BuildValidPrimitiveProperty(); ODataSelectPath path = new ODataSelectPath( new ODataPathSegment[] { new NavigationPropertySegment( HardCodedTestModel.GetPersonMyDogNavProp(), HardCodedTestModel.GetDogsSet()) } ); Assert.Equal(1, path.ToExpandPath().Count); Assert.Equal("MyDog", path.ToExpandPath().FirstSegment.Identifier); }
public void PathExtensionsToExpandPathWithNonNavigationPropertyThrows() { var property = mbh.BuildValidPrimitiveProperty(); ODataSelectPath path = new ODataSelectPath( new ODataPathSegment[] { new PropertySegment(HardCodedTestModel.GetPersonNameProp()) } ); Action expandPathAction = () => path.ToExpandPath(); expandPathAction.Throws <ODataException>(ODataErrorStrings.ODataExpandPath_OnlyLastSegmentMustBeNavigationProperty); }