[InlineData("2012-09-03T24:00-03:00")] // Lexer should parse but should fail in ConstantNodeParser
        public void Parse_DateTimeOffset_Abnf_Failures(string value)
        {
            ODataException odataException = Assert.Throws <ODataException>(() => ConstantNodeParser.ParseConstantNode(new Token(TokenType.DateTimeOffset, value, 0)));

            Assert.Equal(ExceptionMessage.UnableToParseDateTimeOffset, odataException.Message);
            Assert.Equal(HttpStatusCode.BadRequest, odataException.StatusCode);
            Assert.Equal("$filter", odataException.Target);
        }
 public Parse_Base64Binary()
 {
     // Base64 of Net.Http.OData
     _node = (ConstantNode <byte[]>)ConstantNodeParser.ParseConstantNode(new Token(TokenType.Base64Binary, "TmV0Lkh0dHAuT0RhdGE=", 0));
 }
        public void ParseConstantNode_Throws_NotSupportedException_For_UnsupportedTokenType()
        {
            NotSupportedException exception = Assert.Throws <NotSupportedException>(() => ConstantNodeParser.ParseConstantNode(new Token(TokenType.Comma, ",", 0)));

            Assert.Equal("Comma", exception.Message);
        }
 public void Parse_True_Returns_ConstantNodeTrue()
 => Assert.Equal(ConstantNode.True, ConstantNodeParser.ParseConstantNode(new Token(TokenType.True, "true", 0)));
 public void Parse_Null_Returns_ConstantNodeNull()
 => Assert.Equal(ConstantNode.Null, ConstantNodeParser.ParseConstantNode(new Token(TokenType.Null, "null", 0)));
 public void Parse_NegativeInf_Returns_ConstantNodeNaN()
 => Assert.Equal(ConstantNode.NegativeInfinity, ConstantNodeParser.ParseConstantNode(new Token(TokenType.Double, "-INF", 0)));
 public void Parse_Nan_Returns_ConstantNodeNaN()
 => Assert.Equal(ConstantNode.NaN, ConstantNodeParser.ParseConstantNode(new Token(TokenType.Double, "NaN", 0)));
 public void Parse_Int64_Zero_Returns_ConstantNodeInt64Zero()
 {
     Assert.Equal(ConstantNode.Int64Zero, ConstantNodeParser.ParseConstantNode(new Token(TokenType.Integer, "0l", 0)));
     Assert.Equal(ConstantNode.Int64Zero, ConstantNodeParser.ParseConstantNode(new Token(TokenType.Integer, "0L", 0)));
 }
 public void Parse_Int32_Zero_Returns_ConstantNodeInt32Zero()
 => Assert.Equal(ConstantNode.Int32Zero, ConstantNodeParser.ParseConstantNode(new Token(TokenType.Integer, "0", 0)));
 public void Parse_False_Returns_ConstantNodeFalse()
 => Assert.Equal(ConstantNode.False, ConstantNodeParser.ParseConstantNode(new Token(TokenType.False, "false", 0)));
            public Parse_Enum()
            {
                TestHelper.EnsureEDM();

                _node = (ConstantNode <AccessLevel>)ConstantNodeParser.ParseConstantNode(new Token(TokenType.Enum, "Sample.Model.AccessLevel'Read'", 0));
            }