public void CollectionNavigationNodeConstructorRequiresManyMultiplicity()
        {
            var    source = FakeSingleEntityNode.CreateFakeSingleEntityNodeForPerson();
            Action create = () => new CollectionNavigationNode(HardCodedTestModel.GetPersonMyDogNavProp(), source);

            create.ShouldThrow <ArgumentException>().WithMessage(ODataErrorStrings.Nodes_CollectionNavigationNode_MustHaveManyMultiplicity);
        }
Beispiel #2
0
        public void KindIsEntitySet()
        {
            var source = FakeSingleEntityNode.CreateFakeSingleEntityNodeForPerson();
            var node   = new SingleNavigationNode(HardCodedTestModel.GetPersonMyDogNavProp(), source);

            node.InternalKind.Should().Be(InternalQueryNodeKind.SingleNavigationNode);
        }
Beispiel #3
0
        public void EntitySetIsCalculatedCorrectly()
        {
            var source = FakeSingleEntityNode.CreateFakeSingleEntityNodeForPerson();
            var node   = new SingleNavigationNode(HardCodedTestModel.GetPersonMyDogNavProp(), source);

            node.NavigationSource.Should().BeSameAs(HardCodedTestModel.GetDogsSet());
        }
Beispiel #4
0
        public void EntityTypeIsSameAsType()
        {
            var source = FakeSingleEntityNode.CreateFakeSingleEntityNodeForPerson();
            var node   = new SingleNavigationNode(HardCodedTestModel.GetPersonMyDogNavProp(), source);

            node.EntityTypeReference.Should().BeSameAs(node.TypeReference);
        }
Beispiel #5
0
        public void TypeReferenceIsExactlyFromProperty()
        {
            var source = FakeSingleEntityNode.CreateFakeSingleEntityNodeForPerson();
            var node   = new SingleNavigationNode(HardCodedTestModel.GetPersonMyDogNavProp(), source);

            node.TypeReference.Should().BeSameAs(HardCodedTestModel.GetPersonMyDogNavProp().Type);
        }
Beispiel #6
0
        public void SourceIsSet()
        {
            var source = FakeSingleEntityNode.CreateFakeSingleEntityNodeForPerson();
            var node   = new SingleNavigationNode(HardCodedTestModel.GetPersonMyDogNavProp(), source);

            node.Source.Should().BeSameAs(source);
        }