public static void IsVariableBooleanSuccess() { var state = new ParserState("foobar is false", 4, new RumorParserState()); var scope = new RumorScope(); scope.Set("foobar", false); var result = Compiler.Comparison(state); Assert.AreEqual(new BooleanValue(true), result.Evaluate(scope)); }
public static void IsVariableNumberFailure() { var state = new ParserState("foobar is 5", 4, new RumorParserState()); var scope = new RumorScope(); scope.Set("foobar", 4); var result = Compiler.Comparison(state); Assert.AreEqual(new BooleanValue(false), result.Evaluate(scope)); }
public static void VariableSuccess() { var state = new ParserState("foobar", 4, new RumorParserState()); var scope = new RumorScope(); scope.Set("foobar", 1234); var n = Compiler.Math(state); Assert.AreEqual(new NumberValue(1234), n.Evaluate(scope)); }