AggregateTokenBase

We found 10 examples in language CSharp for this search. You will see 36 fragments of code.
//---------------------------------------------------------------------
// <copyright file="AggregateTokenBase.cs" company="Microsoft">
//      Copyright (C) Microsoft Corporation. All rights reserved. See License.txt in the project root for license information.
// </copyright>
//---------------------------------------------------------------------

#if ODATA_CLIENT
namespace Microsoft.OData.Client.ALinq.UriParser
#else
namespace Microsoft.OData.UriParser.Aggregation
#endif
{
    /// <summary>
    /// Base class for Aggregate transformation tokens
    /// </summary>
    public abstract class AggregateTokenBase : ApplyTransformationToken
    {
    }
}

//---------------------------------------------------------------------
// <copyright file="AggregateTokenBase.cs" company="Microsoft">
//      Copyright (C) Microsoft Corporation. All rights reserved. See License.txt in the project root for license information.
// </copyright>
//---------------------------------------------------------------------

#if ODATA_CLIENT
namespace Microsoft.OData.Client.ALinq.UriParser
#else
namespace Microsoft.OData.UriParser.Aggregation
#endif
{
    /// <summary>
    /// Base class for Aggregate transformation tokens
    /// </summary>
    public abstract class AggregateTokenBase : ApplyTransformationToken
    {
    }
}


        [Fact]
        public void StatementsCannotBeNull()
        {
            Action action = () => new AggregateToken(null);
            Assert.Throws<ArgumentNullException>("expressions", action);
        }

        [Fact]
        public void StatementsSetCorrectly()
        {
            AggregateToken token = new AggregateToken(statements);
            Assert.Same(statements, token.AggregateExpressions);
        }

        [Fact]
        public void KindIsSetCorrectly()
        {
            AggregateToken token = new AggregateToken(statements);
            Assert.Equal(QueryTokenKind.Aggregate, token.Kind);
        }


        [Fact]
        public void PropertiesCannotBeNull()
        {
            Action action = () => new GroupByToken(null, aggregate);
            Assert.Throws<ArgumentNullException>("properties", action);
        }

        [Fact]
        public void AggregateCanBeNull()
        {
            Action action = () => new GroupByToken(properties, null);
            action.DoesNotThrow();
        }

        [Fact]
        public void PropertiesSetCorrectly()
        {
            var token = new GroupByToken(properties, null);
            Assert.Same(properties, ((object)token.Properties));
        }

        [Fact]
        public void AggregateSetCorrectly()
        {
            var token = new GroupByToken(properties, aggregate);
            Assert.Same(aggregate, ((object)token.Child));
        }

        [Fact]
        public void KindIsSetCorrectly()
        {
            var token = new GroupByToken(properties, null);

            Assert.Equal(QueryTokenKind.AggregateGroupBy, token.Kind);
        }


        /// <summary>
        /// Accept a <see cref="ISyntacticTreeVisitor{T}"/> to walk a tree of <see cref="QueryToken"/>s.
        /// </summary>
        /// <typeparam name="T">Type that the visitor will return after visiting this token.</typeparam>
        /// <param name="visitor">An implementation of the visitor interface.</param>
        /// <returns>An object whose type is determined by the type parameter of the visitor.</returns>
        public override T Accept<T>(ISyntacticTreeVisitor<T> visitor)
        {
            return visitor.Visit(this);
        }


        /// <summary>
        /// Accept a <see cref="ISyntacticTreeVisitor{T}"/> to walk a tree of <see cref="QueryToken"/>s.
        /// </summary>
        /// <typeparam name="T">Type that the visitor will return after visiting this token.</typeparam>
        /// <param name="visitor">An implementation of the visitor interface.</param>
        /// <returns>An object whose type is determined by the type parameter of the visitor.</returns>
        public override T Accept<T>(ISyntacticTreeVisitor<T> visitor)
        {
            return visitor.Visit(this);
        }


        /// <summary>
        /// Parses the $filter expression.
        /// </summary>
        /// <param name="filter">The $filter expression string to parse.</param>
        /// <returns>The lexical token representing the filter.</returns>
        public QueryToken ParseFilter(string filter)
        {
            return this.ParseExpressionText(filter);
        }

        /// <summary>
        /// Parses a literal.
        /// </summary>
        /// <param name="lexer">The lexer to use.</param>
        /// <returns>The literal query token or null if something else was found.</returns>
        internal static LiteralToken TryParseLiteral(ExpressionLexer lexer)
        {
            Debug.Assert(lexer != null, "lexer != null");

            switch (lexer.CurrentToken.Kind)
            {
                case ExpressionTokenKind.BooleanLiteral:
                case ExpressionTokenKind.DateLiteral:
                case ExpressionTokenKind.DecimalLiteral:
                case ExpressionTokenKind.StringLiteral:
                case ExpressionTokenKind.Int64Literal:
                case ExpressionTokenKind.IntegerLiteral:
                case ExpressionTokenKind.DoubleLiteral:
                case ExpressionTokenKind.SingleLiteral:
                case ExpressionTokenKind.GuidLiteral:
                case ExpressionTokenKind.BinaryLiteral:
                case ExpressionTokenKind.GeographyLiteral:
                case ExpressionTokenKind.GeometryLiteral:
                case ExpressionTokenKind.QuotedLiteral:
                case ExpressionTokenKind.DurationLiteral:
                case ExpressionTokenKind.TimeOfDayLiteral:
                case ExpressionTokenKind.DateTimeOffsetLiteral:
                case ExpressionTokenKind.CustomTypeLiteral:
                    IEdmTypeReference literalEdmTypeReference = lexer.CurrentToken.GetLiteralEdmTypeReference();

                    // Why not using EdmTypeReference.FullName? (literalEdmTypeReference.FullName)
                    string edmConstantName = GetEdmConstantNames(literalEdmTypeReference);
                    return ParseTypedLiteral(lexer, literalEdmTypeReference, edmConstantName);

                case ExpressionTokenKind.BracedExpression:
                case ExpressionTokenKind.BracketedExpression:
                case ExpressionTokenKind.ParenthesesExpression:
                    {
                        LiteralToken result = new LiteralToken(lexer.CurrentToken.Text, lexer.CurrentToken.Text);
                        lexer.NextToken();
                        return result;
                    }

                case ExpressionTokenKind.NullLiteral:
                    return ParseNullLiteral(lexer);

                default:
                    return null;
            }
        }

        internal static string GetEdmConstantNames(IEdmTypeReference edmTypeReference)
        {
            Debug.Assert(edmTypeReference != null, "Cannot be null");

            switch (edmTypeReference.PrimitiveKind())
            {
                case EdmPrimitiveTypeKind.Boolean:
                    return Microsoft.OData.Metadata.EdmConstants.EdmBooleanTypeName;
                case EdmPrimitiveTypeKind.TimeOfDay:
                    return Microsoft.OData.Metadata.EdmConstants.EdmTimeOfDayTypeName;
                case EdmPrimitiveTypeKind.Date:
                    return Microsoft.OData.Metadata.EdmConstants.EdmDateTypeName;
                case EdmPrimitiveTypeKind.DateTimeOffset:
                    return Microsoft.OData.Metadata.EdmConstants.EdmDateTimeOffsetTypeName;
                case EdmPrimitiveTypeKind.Duration:
                    return Microsoft.OData.Metadata.EdmConstants.EdmDurationTypeName;
                case EdmPrimitiveTypeKind.Decimal:
                    return Microsoft.OData.Metadata.EdmConstants.EdmDecimalTypeName;
                case EdmPrimitiveTypeKind.String:
                    return Microsoft.OData.Metadata.EdmConstants.EdmStringTypeName;
                case EdmPrimitiveTypeKind.Int64:
                    return Microsoft.OData.Metadata.EdmConstants.EdmInt64TypeName;
                case EdmPrimitiveTypeKind.Int32:
                    return Microsoft.OData.Metadata.EdmConstants.EdmInt32TypeName;
                case EdmPrimitiveTypeKind.Double:
                    return Microsoft.OData.Metadata.EdmConstants.EdmDoubleTypeName;
                case EdmPrimitiveTypeKind.Single:
                    return Microsoft.OData.Metadata.EdmConstants.EdmSingleTypeName;
                case EdmPrimitiveTypeKind.Guid:
                    return Microsoft.OData.Metadata.EdmConstants.EdmGuidTypeName;
                case EdmPrimitiveTypeKind.Binary:
                    return Microsoft.OData.Metadata.EdmConstants.EdmBinaryTypeName;
                case EdmPrimitiveTypeKind.Geography:
                    return Microsoft.OData.Metadata.EdmConstants.EdmGeographyTypeName;
                case EdmPrimitiveTypeKind.Geometry:
                    return Microsoft.OData.Metadata.EdmConstants.EdmGeometryTypeName;
                default:
                    return edmTypeReference.Definition.FullTypeName();
            }
        }

        // parses $apply compute expression (.e.g. compute(UnitPrice mul SalesPrice as computePrice)
        internal ComputeToken ParseCompute()
        {
            Debug.Assert(TokenIdentifierIs(ExpressionConstants.KeywordCompute), "token identifier is compute");

            lexer.NextToken();

            // '('
            if (this.lexer.CurrentToken.Kind != ExpressionTokenKind.OpenParen)
            {
                throw ParseError(ODataErrorStrings.UriQueryExpressionParser_OpenParenExpected(this.lexer.CurrentToken.Position, this.lexer.ExpressionText));
            }

            lexer.NextToken();

            List<ComputeExpressionToken> transformationTokens = new List<ComputeExpressionToken>();

            while (true)
            {
                ComputeExpressionToken computed = this.ParseComputeExpression();
                transformationTokens.Add(computed);
                if (this.lexer.CurrentToken.Kind != ExpressionTokenKind.Comma)
                {
                    break;
                }

                this.lexer.NextToken();
            }

            // ")"
            if (this.lexer.CurrentToken.Kind != ExpressionTokenKind.CloseParen)
            {
                throw ParseError(ODataErrorStrings.UriQueryExpressionParser_CloseParenOrCommaExpected(this.lexer.CurrentToken.Position, this.lexer.ExpressionText));
            }

            this.lexer.NextToken();

            return new ComputeToken(transformationTokens);
        }

        // parses $compute query option.
        internal ComputeToken ParseCompute(string compute)
        {
            Debug.Assert(compute != null, "compute != null");

            List<ComputeExpressionToken> transformationTokens = new List<ComputeExpressionToken>();

            if (string.IsNullOrEmpty(compute))
            {
                return new ComputeToken(transformationTokens);
            }

            this.recursionDepth = 0;
            this.lexer = CreateLexerForFilterOrOrderByOrApplyExpression(compute);

            while (true)
            {
                ComputeExpressionToken computed = this.ParseComputeExpression();
                transformationTokens.Add(computed);
                if (this.lexer.CurrentToken.Kind != ExpressionTokenKind.Comma)
                {
                    break;
                }

                this.lexer.NextToken();
            }

            this.lexer.ValidateToken(ExpressionTokenKind.End);

            return new ComputeToken(transformationTokens);
        }

        internal ExpandToken ParseExpand()
        {
            Debug.Assert(TokenIdentifierIs(ExpressionConstants.KeywordExpand), "token identifier is expand");
            lexer.NextToken();

            // '('
            if (this.lexer.CurrentToken.Kind != ExpressionTokenKind.OpenParen)
            {
                throw ParseError(ODataErrorStrings.UriQueryExpressionParser_OpenParenExpected(this.lexer.CurrentToken.Position, this.lexer.ExpressionText));
            }

            this.lexer.NextToken();

            List<ExpandTermToken> termTokens = new List<ExpandTermToken>();

            // First token must be Path
            var termParser = new SelectExpandTermParser(this.lexer, this.maxDepth - 1, false);
            PathSegmentToken pathToken = termParser.ParseTerm(allowRef: true);

            QueryToken filterToken = null;
            ExpandToken nestedExpand = null;

            // Followed (optionally) by filter and expand
            // Syntax for expand inside $apply is different (and much simpler)  from $expand clause => had to use different parsing approach
            while (this.lexer.CurrentToken.Kind == ExpressionTokenKind.Comma)
            {
                this.lexer.NextToken();
                if (this.lexer.CurrentToken.Kind == ExpressionTokenKind.Identifier)
                {
                    switch (this.lexer.CurrentToken.GetIdentifier())
                    {
                        case ExpressionConstants.KeywordFilter:
                            filterToken = this.ParseApplyFilter();
                            break;
                        case ExpressionConstants.KeywordExpand:
                            ExpandToken tempNestedExpand = ParseExpand();
                            nestedExpand = nestedExpand == null
                                ? tempNestedExpand
                                : new ExpandToken(nestedExpand.ExpandTerms.Concat(tempNestedExpand.ExpandTerms));
                            break;
                        default:
                            throw ParseError(ODataErrorStrings.UriQueryExpressionParser_KeywordOrIdentifierExpected(supportedKeywords, this.lexer.CurrentToken.Position, this.lexer.ExpressionText));
                    }
                }
            }

            // Leaf level expands require filter
            if (filterToken == null && nestedExpand == null)
            {
                throw ParseError(ODataErrorStrings.UriQueryExpressionParser_InnerMostExpandRequireFilter(this.lexer.CurrentToken.Position, this.lexer.ExpressionText));
            }

            ExpandTermToken expandTermToken = new ExpandTermToken(pathToken, filterToken, null, null, null, null, null, null, null, nestedExpand);
            termTokens.Add(expandTermToken);

            // ")"
            if (this.lexer.CurrentToken.Kind != ExpressionTokenKind.CloseParen)
            {
                throw ParseError(ODataErrorStrings.UriQueryExpressionParser_CloseParenOrCommaExpected(this.lexer.CurrentToken.Position, this.lexer.ExpressionText));
            }

            this.lexer.NextToken();


            return new ExpandToken(termTokens);
        }


        /// <summary>
        /// Parses the $filter expression.
        /// </summary>
        /// <param name="filter">The $filter expression string to parse.</param>
        /// <returns>The lexical token representing the filter.</returns>
        public QueryToken ParseFilter(string filter)
        {
            return this.ParseExpressionText(filter);
        }

        /// <summary>
        /// Parses a literal.
        /// </summary>
        /// <param name="lexer">The lexer to use.</param>
        /// <returns>The literal query token or null if something else was found.</returns>
        internal static LiteralToken TryParseLiteral(ExpressionLexer lexer)
        {
            Debug.Assert(lexer != null, "lexer != null");

            switch (lexer.CurrentToken.Kind)
            {
                case ExpressionTokenKind.BooleanLiteral:
                case ExpressionTokenKind.DateLiteral:
                case ExpressionTokenKind.DecimalLiteral:
                case ExpressionTokenKind.StringLiteral:
                case ExpressionTokenKind.Int64Literal:
                case ExpressionTokenKind.IntegerLiteral:
                case ExpressionTokenKind.DoubleLiteral:
                case ExpressionTokenKind.SingleLiteral:
                case ExpressionTokenKind.GuidLiteral:
                case ExpressionTokenKind.BinaryLiteral:
                case ExpressionTokenKind.GeographyLiteral:
                case ExpressionTokenKind.GeometryLiteral:
                case ExpressionTokenKind.QuotedLiteral:
                case ExpressionTokenKind.DurationLiteral:
                case ExpressionTokenKind.TimeOfDayLiteral:
                case ExpressionTokenKind.DateTimeOffsetLiteral:
                case ExpressionTokenKind.CustomTypeLiteral:
                    IEdmTypeReference literalEdmTypeReference = lexer.CurrentToken.GetLiteralEdmTypeReference();

                    // Why not using EdmTypeReference.FullName? (literalEdmTypeReference.FullName)
                    string edmConstantName = GetEdmConstantNames(literalEdmTypeReference);
                    return ParseTypedLiteral(lexer, literalEdmTypeReference, edmConstantName);

                case ExpressionTokenKind.BracedExpression:
                case ExpressionTokenKind.BracketedExpression:
                case ExpressionTokenKind.ParenthesesExpression:
                    {
                        LiteralToken result = new LiteralToken(lexer.CurrentToken.Text, lexer.CurrentToken.Text);
                        lexer.NextToken();
                        return result;
                    }

                case ExpressionTokenKind.NullLiteral:
                    return ParseNullLiteral(lexer);

                default:
                    return null;
            }
        }

        internal static string GetEdmConstantNames(IEdmTypeReference edmTypeReference)
        {
            Debug.Assert(edmTypeReference != null, "Cannot be null");

            switch (edmTypeReference.PrimitiveKind())
            {
                case EdmPrimitiveTypeKind.Boolean:
                    return Microsoft.OData.Metadata.EdmConstants.EdmBooleanTypeName;
                case EdmPrimitiveTypeKind.TimeOfDay:
                    return Microsoft.OData.Metadata.EdmConstants.EdmTimeOfDayTypeName;
                case EdmPrimitiveTypeKind.Date:
                    return Microsoft.OData.Metadata.EdmConstants.EdmDateTypeName;
                case EdmPrimitiveTypeKind.DateTimeOffset:
                    return Microsoft.OData.Metadata.EdmConstants.EdmDateTimeOffsetTypeName;
                case EdmPrimitiveTypeKind.Duration:
                    return Microsoft.OData.Metadata.EdmConstants.EdmDurationTypeName;
                case EdmPrimitiveTypeKind.Decimal:
                    return Microsoft.OData.Metadata.EdmConstants.EdmDecimalTypeName;
                case EdmPrimitiveTypeKind.String:
                    return Microsoft.OData.Metadata.EdmConstants.EdmStringTypeName;
                case EdmPrimitiveTypeKind.Int64:
                    return Microsoft.OData.Metadata.EdmConstants.EdmInt64TypeName;
                case EdmPrimitiveTypeKind.Int32:
                    return Microsoft.OData.Metadata.EdmConstants.EdmInt32TypeName;
                case EdmPrimitiveTypeKind.Double:
                    return Microsoft.OData.Metadata.EdmConstants.EdmDoubleTypeName;
                case EdmPrimitiveTypeKind.Single:
                    return Microsoft.OData.Metadata.EdmConstants.EdmSingleTypeName;
                case EdmPrimitiveTypeKind.Guid:
                    return Microsoft.OData.Metadata.EdmConstants.EdmGuidTypeName;
                case EdmPrimitiveTypeKind.Binary:
                    return Microsoft.OData.Metadata.EdmConstants.EdmBinaryTypeName;
                case EdmPrimitiveTypeKind.Geography:
                    return Microsoft.OData.Metadata.EdmConstants.EdmGeographyTypeName;
                case EdmPrimitiveTypeKind.Geometry:
                    return Microsoft.OData.Metadata.EdmConstants.EdmGeometryTypeName;
                default:
                    return edmTypeReference.Definition.FullTypeName();
            }
        }

        // parses $apply compute expression (.e.g. compute(UnitPrice mul SalesPrice as computePrice)
        internal ComputeToken ParseCompute()
        {
            Debug.Assert(TokenIdentifierIs(ExpressionConstants.KeywordCompute), "token identifier is compute");

            lexer.NextToken();

            // '('
            if (this.lexer.CurrentToken.Kind != ExpressionTokenKind.OpenParen)
            {
                throw ParseError(ODataErrorStrings.UriQueryExpressionParser_OpenParenExpected(this.lexer.CurrentToken.Position, this.lexer.ExpressionText));
            }

            lexer.NextToken();

            List<ComputeExpressionToken> transformationTokens = new List<ComputeExpressionToken>();

            while (true)
            {
                ComputeExpressionToken computed = this.ParseComputeExpression();
                transformationTokens.Add(computed);
                if (this.lexer.CurrentToken.Kind != ExpressionTokenKind.Comma)
                {
                    break;
                }

                this.lexer.NextToken();
            }

            // ")"
            if (this.lexer.CurrentToken.Kind != ExpressionTokenKind.CloseParen)
            {
                throw ParseError(ODataErrorStrings.UriQueryExpressionParser_CloseParenOrCommaExpected(this.lexer.CurrentToken.Position, this.lexer.ExpressionText));
            }

            this.lexer.NextToken();

            return new ComputeToken(transformationTokens);
        }

        // parses $compute query option.
        internal ComputeToken ParseCompute(string compute)
        {
            Debug.Assert(compute != null, "compute != null");

            List<ComputeExpressionToken> transformationTokens = new List<ComputeExpressionToken>();

            if (string.IsNullOrEmpty(compute))
            {
                return new ComputeToken(transformationTokens);
            }

            this.recursionDepth = 0;
            this.lexer = CreateLexerForFilterOrOrderByOrApplyExpression(compute);

            while (true)
            {
                ComputeExpressionToken computed = this.ParseComputeExpression();
                transformationTokens.Add(computed);
                if (this.lexer.CurrentToken.Kind != ExpressionTokenKind.Comma)
                {
                    break;
                }

                this.lexer.NextToken();
            }

            this.lexer.ValidateToken(ExpressionTokenKind.End);

            return new ComputeToken(transformationTokens);
        }

        internal ExpandToken ParseExpand()
        {
            Debug.Assert(TokenIdentifierIs(ExpressionConstants.KeywordExpand), "token identifier is expand");
            lexer.NextToken();

            // '('
            if (this.lexer.CurrentToken.Kind != ExpressionTokenKind.OpenParen)
            {
                throw ParseError(ODataErrorStrings.UriQueryExpressionParser_OpenParenExpected(this.lexer.CurrentToken.Position, this.lexer.ExpressionText));
            }

            this.lexer.NextToken();

            List<ExpandTermToken> termTokens = new List<ExpandTermToken>();

            // First token must be Path
            var termParser = new SelectExpandTermParser(this.lexer, this.maxDepth - 1, false);
            PathSegmentToken pathToken = termParser.ParseTerm(allowRef: true);

            QueryToken filterToken = null;
            ExpandToken nestedExpand = null;

            // Followed (optionally) by filter and expand
            // Syntax for expand inside $apply is different (and much simpler)  from $expand clause => had to use different parsing approach
            while (this.lexer.CurrentToken.Kind == ExpressionTokenKind.Comma)
            {
                this.lexer.NextToken();
                if (this.lexer.CurrentToken.Kind == ExpressionTokenKind.Identifier)
                {
                    switch (this.lexer.CurrentToken.GetIdentifier())
                    {
                        case ExpressionConstants.KeywordFilter:
                            filterToken = this.ParseApplyFilter();
                            break;
                        case ExpressionConstants.KeywordExpand:
                            ExpandToken tempNestedExpand = ParseExpand();
                            nestedExpand = nestedExpand == null
                                ? tempNestedExpand
                                : new ExpandToken(nestedExpand.ExpandTerms.Concat(tempNestedExpand.ExpandTerms));
                            break;
                        default:
                            throw ParseError(ODataErrorStrings.UriQueryExpressionParser_KeywordOrIdentifierExpected(supportedKeywords, this.lexer.CurrentToken.Position, this.lexer.ExpressionText));
                    }
                }
            }

            // Leaf level expands require filter
            if (filterToken == null && nestedExpand == null)
            {
                throw ParseError(ODataErrorStrings.UriQueryExpressionParser_InnerMostExpandRequireFilter(this.lexer.CurrentToken.Position, this.lexer.ExpressionText));
            }

            ExpandTermToken expandTermToken = new ExpandTermToken(pathToken, filterToken, null, null, null, null, null, null, null, nestedExpand);
            termTokens.Add(expandTermToken);

            // ")"
            if (this.lexer.CurrentToken.Kind != ExpressionTokenKind.CloseParen)
            {
                throw ParseError(ODataErrorStrings.UriQueryExpressionParser_CloseParenOrCommaExpected(this.lexer.CurrentToken.Position, this.lexer.ExpressionText));
            }

            this.lexer.NextToken();


            return new ExpandToken(termTokens);
        }


        [Fact]
        public void AllNotImplemented()
        {
            FakeVisitor visitor = new FakeVisitor();
            Action visitAllToken = () => visitor.Visit(new AllToken(null, null, null));
            Assert.Throws<NotImplementedException>(visitAllToken);
        }

        [Fact]
        public void AnyNotImplemented()
        {
            FakeVisitor visitor = new FakeVisitor();
            Action visitAnyToken = () => visitor.Visit(new AnyToken(null, null, null));
            Assert.Throws<NotImplementedException>(visitAnyToken);
        }

        [Fact]
        public void BinaryOperatorNotImplemented()
        {
            FakeVisitor visitor = new FakeVisitor();
            Action visitBinaryOperatorToken = () => visitor.Visit(new BinaryOperatorToken(BinaryOperatorKind.Equal, new LiteralToken(1), new LiteralToken(1)));
            Assert.Throws<NotImplementedException>(visitBinaryOperatorToken);
        }

        [Fact]
        public void CastNotImplemented()
        {
            FakeVisitor visitor = new FakeVisitor();
            Action visitCastToken = () => visitor.Visit(new DottedIdentifierToken("stuff", null));
            Assert.Throws<NotImplementedException>(visitCastToken);
        }

        [Fact]
        public void ExpandNotImplemented()
        {
            FakeVisitor visitor = new FakeVisitor();
            Action visitExpandToken = () => visitor.Visit(new ExpandToken(null));
            Assert.Throws<NotImplementedException>(visitExpandToken);
        }

        [Fact]
        public void ExpandTermNotImplemented()
        {
            FakeVisitor visitor = new FakeVisitor();
            Action visitExpandTermToken = () => visitor.Visit(new ExpandTermToken(new NonSystemToken("stuff", null, null), 
                                                                                  null /*selectOption*/,
                                                                                  null /*expandOption*/));
            Assert.Throws<NotImplementedException>(visitExpandTermToken);
        }


        [Fact]
        public void AnyAllSyntacticParsingShouldCheckSeperatorTokenIsColon()
        {
            // Repro for: Syntactic parsing for Any/All allows an arbitrary token between range variable and expression
            Action parse = () => this.testSubject.ParseFilter("Things/any(a,true)");
            parse.Throws<ODataException>(ErrorStrings.ExpressionLexer_SyntaxError("13", "Things/any(a,true)"));
        }

        [Fact]
        public void AnyAllSyntacticParsingShouldNotAllowImplicitRangeVariableToBeRedefined()
        {
            // Repro for: Syntactic parser fails to block $it as a range variable name
            Action parse = () => this.testSubject.ParseFilter("Things/any($it:true)");
            parse.Throws<ODataException>(ErrorStrings.UriQueryExpressionParser_RangeVariableAlreadyDeclared("$it"));
        }

        [Fact]
        public void AnyAllSyntacticParsingShouldNotAllowAnyRangeVariableToBeRedefined()
        {
            // Repro for: Semantic binding fails with useless error message when a range variable is redefined within a nested any/all
            Action parse = () => this.testSubject.ParseFilter("Things/any(o:o/Things/any(o:true))");
            parse.Throws<ODataException>(ErrorStrings.UriQueryExpressionParser_RangeVariableAlreadyDeclared("o"));
        }

        [Fact]
        public void AnyAllSyntacticParsingShouldNotRecognizeRangeVariablesOutsideOfScope()
        {
            // Repro for: Syntactic parser assumes any token which matches the name of a previously used range variable is also a range variable, even after the scope has been exited
            QueryToken tree = this.testSubject.ParseFilter("Things/any(o:true) and o");
            tree.ShouldBeBinaryOperatorQueryToken(BinaryOperatorKind.And).Right.ShouldBeEndPathToken("o");
        }

        [Fact]
        public void TypeNameShouldParseSuccessfully()
        {
            this.testSubject.ParseFilter("fq.ns.typename").ShouldBeDottedIdentifierToken("fq.ns.typename");
        }

        [Fact]
        public void QualifiedFunctionNameShouldParseSuccessfully()
        {
            this.testSubject.ParseFilter("fq.ns.container.function()").ShouldBeFunctionCallToken("fq.ns.container.function");
        }

Microsoft.OData.UriParser.Aggregation.AggregateTokenBase : ApplyTransformationToken

Methods :

public abstract QueryTokenKind get_Kind()
public abstract T Accept(ISyntacticTreeVisitor<T> visitor = )
public Type GetType()
public String ToString()
public Boolean Equals(Object obj = )
public Int32 GetHashCode()