예제 #1
0
        public void ParseTextExpressionTest()
        {
            //Create parser and parse tokens
            ExpressionParser expressionParser = new ExpressionParser(Init("text"));
            TextExpression   expression       = expressionParser.ParseTextExpression();

            //Test variable identifier
            Assert.AreEqual("text", expression.GetText());
        }
예제 #2
0
        public void ParseKeyValuePairTest()
        {
            //Create parser and parse tokens
            ExpressionParser expressionParser = new ExpressionParser(Init("token1:\"value1\""));
            KeyValuePair     keyValuePair     = expressionParser.ParseKeyValuePair();

            //Check key
            Assert.AreEqual("token1", keyValuePair.GetKey());

            //Check value
            Assert.AreEqual(typeof(TextExpression), keyValuePair.GetValue().GetType());
            TextExpression textExpression = (TextExpression)keyValuePair.GetValue();

            Assert.AreEqual("value1", textExpression.GetText());
        }