Ejemplo n.º 1
0
        public void CreateNextSegmentForEntitySetWithKeyWorks()
        {
            IList <PathSegment> path = new List <PathSegment>();

            PathParser.CreateFirstSegment("users", _edmModel, path, PathParserSettings.Default);

            Assert.NotEmpty(path);
            var pathSegment = Assert.Single(path);

            var entitySetSegment = Assert.IsType <EntitySetSegment>(pathSegment);

            Assert.Same(entitySetSegment.EntitySet, _users);

            PathParser.CreateNextSegment("{id | userPrincipalName}", _edmModel, path, PathParserSettings.Default);

            Assert.Equal(2, path.Count);

            var keySegment = Assert.IsType <KeySegment>(path[1]);
        }