public static void BindingAction3Success() { var userState = new RumorParserState(); userState.LinkAction("foobar", ValueType.Boolean, ValueType.Number, ValueType.String ); var state = new ParserState( "foobar(true or false, 4 + 4, \"hello\")", 4, userState ); var result = Compiler.BindingAction()(state); Assert.AreEqual( new BindingActionNode("foobar", new BooleanLiteral(true), new NumberLiteral(8), new StringLiteral("hello") ), result ); }
public static void BindingAction0Success() { var userState = new RumorParserState(); userState.LinkAction("foobar"); var state = new ParserState( "foobar()", 4, userState ); var result = Compiler.BindingAction()(state); Assert.AreEqual(new BindingActionNode("foobar"), result); }
public static void BindingAction1Success() { var userState = new RumorParserState(); userState.LinkAction("foobar", ValueType.Boolean ); var state = new ParserState( "foobar(true or false)", 4, userState ); var result = Compiler.BindingAction()(state); Assert.AreEqual( new BindingActionNode("foobar", new BooleanLiteral(true) ), result ); }