public void SingleExpandResultsInSingleExpandTree()
 {
     SelectExpandPathToStringVisitor visitor = new SelectExpandPathToStringVisitor();
     NonSystemToken path = new NonSystemToken("NavProp", null, null);
     path.IsStructuralProperty = false;
     path.Accept(visitor).Should().Be("NavProp");
 }
 public void SystemTokenThrows()
 {
     SelectExpandPathToStringVisitor visitor = new SelectExpandPathToStringVisitor();
     SystemToken systemToken = new SystemToken(ExpressionConstants.It, null);
     Action visitSystemToken = () => systemToken.Accept(visitor);
     visitSystemToken.ShouldThrow<NotSupportedException>().WithMessage(Strings.ALinq_IllegalSystemQueryOption(ExpressionConstants.It));
 }
        public void SingleExpandResultsInSingleExpandTree()
        {
            SelectExpandPathToStringVisitor visitor = new SelectExpandPathToStringVisitor();
            NonSystemToken path = new NonSystemToken("NavProp", null, null);

            path.IsStructuralProperty = false;
            path.Accept(visitor).Should().Be("NavProp");
        }
        public void SystemTokenThrows()
        {
            SelectExpandPathToStringVisitor visitor = new SelectExpandPathToStringVisitor();
            SystemToken systemToken      = new SystemToken(ExpressionConstants.It, null);
            Action      visitSystemToken = () => systemToken.Accept(visitor);

            visitSystemToken.ShouldThrow <NotSupportedException>().WithMessage(Strings.ALinq_IllegalSystemQueryOption(ExpressionConstants.It));
        }
 public void SelectAtTheEndOfPathResultsInSelectQueryOption()
 {
     SelectExpandPathToStringVisitor visitor = new SelectExpandPathToStringVisitor();
     NonSystemToken path = new NonSystemToken("NavProp", null, new NonSystemToken("StructuralProp", null, null));
     path.IsStructuralProperty = false;
     path.NextToken.IsStructuralProperty = true;
     path.Accept(visitor).Should().Be("NavProp($select=StructuralProp)");
 }
 public void ExpandOnlyPathResultsInExpandOnlyTree()
 {
     SelectExpandPathToStringVisitor visitor = new SelectExpandPathToStringVisitor();
     NonSystemToken path = new NonSystemToken("NavProp", null, new NonSystemToken("NavProp1", null, null));
     path.IsStructuralProperty = false;
     path.NextToken.IsStructuralProperty = false;
     path.Accept(visitor).Should().Be("NavProp($expand=NavProp1)");
 }
        public void SelectAtTheEndOfPathResultsInSelectQueryOption()
        {
            SelectExpandPathToStringVisitor visitor = new SelectExpandPathToStringVisitor();
            NonSystemToken path = new NonSystemToken("NavProp", null, new NonSystemToken("StructuralProp", null, null));

            path.IsStructuralProperty           = false;
            path.NextToken.IsStructuralProperty = true;
            path.Accept(visitor).Should().Be("NavProp($select=StructuralProp)");
        }
        public void ExpandOnlyPathResultsInExpandOnlyTree()
        {
            SelectExpandPathToStringVisitor visitor = new SelectExpandPathToStringVisitor();
            NonSystemToken path = new NonSystemToken("NavProp", null, new NonSystemToken("NavProp1", null, null));

            path.IsStructuralProperty           = false;
            path.NextToken.IsStructuralProperty = false;
            path.Accept(visitor).Should().Be("NavProp($expand=NavProp1)");
        }
        public void SystemTokenThrows()
        {
            SelectExpandPathToStringVisitor visitor = new SelectExpandPathToStringVisitor();
            SystemToken           systemToken       = new SystemToken(ExpressionConstants.It, null);
            Action                visitSystemToken  = () => systemToken.Accept(visitor);
            NotSupportedException exception         = Assert.Throws <NotSupportedException>(visitSystemToken);

            Assert.Equal(Strings.ALinq_IllegalSystemQueryOption(ExpressionConstants.It), exception.Message);
        }
Beispiel #10
0
        /// <summary>
        /// Write out the current list of expansion paths as a list of strings.
        /// </summary>
        /// <returns>The current list of expansion paths as a list of strings.</returns>
        private IEnumerable <string> WriteExpansionPaths()
        {
            SelectExpandPathToStringVisitor visitor = new SelectExpandPathToStringVisitor();

            return(this.expandPaths.Where(path => path != null).Select(path => path.Accept(visitor)));
        }
 /// <summary>
 /// Write out the current list of expansion paths as a list of strings.
 /// </summary>
 /// <returns>The current list of expansion paths as a list of strings.</returns>
 private IEnumerable<string> WriteExpansionPaths()
 {
     SelectExpandPathToStringVisitor visitor = new SelectExpandPathToStringVisitor();
     return this.expandPaths.Where(path => path != null).Select(path => path.Accept(visitor));
 }