コード例 #1
0
        public void EntityReferenceCanAppearAfterSingleton()
        {
            var path = PathFunctionalTestsUtil.RunParsePath("Boss/$ref");

            ReferenceSegment referenceSegment = path.LastSegment as ReferenceSegment;

            Assert.Same(referenceSegment.TargetEdmNavigationSource, HardCodedTestModel.GetBossSingleton());
            Assert.True(referenceSegment.SingleResult);
        }
コード例 #2
0
        public void ValidNavigationPropertyBeforeEntityReference()
        {
            var path = PathFunctionalTestsUtil.RunParsePath("People(7)/MyDog/$ref");

            VerificationHelpers.VerifyPath(path, new Action <ODataPathSegment>[]
            {
                s => s.ShouldBeEntitySetSegment(HardCodedTestModel.GetPeopleSet()),
                s => s.ShouldBeSimpleKeySegment(7),
                s => s.ShouldBeNavigationPropertyLinkSegment(HardCodedTestModel.GetPersonMyDogNavProp()),
            });
        }
コード例 #3
0
        public void KeyOnCollectionEntityReferencesShouldWork()
        {
            var path = PathFunctionalTestsUtil.RunParsePath("Dogs(7)/MyPeople(2)/$ref");

            VerificationHelpers.VerifyPath(path, new Action <ODataPathSegment>[]
            {
                s => s.ShouldBeEntitySetSegment(HardCodedTestModel.GetDogsSet()),
                s => s.ShouldBeSimpleKeySegment(7),
                s => s.ShouldBeNavigationPropertyLinkSegment(HardCodedTestModel.GetDogMyPeopleNavProp()),
                s => s.ShouldBeSimpleKeySegment(2)
            });
        }
コード例 #4
0
        public void EntityReferenceCanAppearAfterASingleValuedNavigationProperty()
        {
            var path = PathFunctionalTestsUtil.RunParsePath("Dogs(1)/FastestOwner/$ref");

            path.LastSegment.ShouldBeNavigationPropertyLinkSegment(HardCodedTestModel.GetDogFastestOwnerNavProp());
        }
コード例 #5
0
        public void EntityReferenceCanAppearAfterACollectionValuedNavigationProperty()
        {
            var path = PathFunctionalTestsUtil.RunParsePath("Dogs(1)/MyPeople/$ref");

            path.LastSegment.ShouldBeNavigationPropertyLinkSegment(HardCodedTestModel.GetDogMyPeopleNavProp());
        }
コード例 #6
0
        public void EntityReferenceCanAppearAfterAnEntitySet()
        {
            var path = PathFunctionalTestsUtil.RunParsePath("People/$ref");

            path.LastSegment.ShouldBeReferenceSegment(HardCodedTestModel.GetPeopleSet());
        }
コード例 #7
0
        public void EntityReferenceCanAppearAfterBoundFunctionReturningSingleEntity()
        {
            var path = PathFunctionalTestsUtil.RunParsePath("People/Fully.Qualified.Namespace.GetPersonWhoHasSmartestDog/$ref");

            path.LastSegment.ShouldBeReferenceSegment(HardCodedTestModel.GetPeopleSet());
        }
コード例 #8
0
        public void EntityReferenceCanAppearAfterCastedType()
        {
            var path = PathFunctionalTestsUtil.RunParsePath("People/Fully.Qualified.Namespace.Employee/$ref");

            path.LastSegment.ShouldBeReferenceSegment(HardCodedTestModel.GetPeopleSet());
        }
コード例 #9
0
        public void EntityReferenceCanAppearAfterAComplexProperty()
        {
            var path = PathFunctionalTestsUtil.RunParsePath("People(1)/MyAddress/$ref");

            path.LastSegment.ShouldBeReferenceSegment(HardCodedTestModel.GetPeopleSet());
        }