示例#1
0
        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));
        }
示例#2
0
        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));
        }
示例#3
0
        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));
        }