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()); }
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()); }