コード例 #1
0
        static void VariableTest6(BooleanContext context, PrefixBooleanParser parser)
        {
            var e1 = parser.Parse("AND OR AND X Y NOT Z W");

            context.SetVariable("X", true);
            context.SetVariable("Y", true);
            context.SetVariable("Z", true);
            context.SetVariable("W", false);

            var expected_value = false;
            var actual_value   = EvaluateAndPrint(e1, context);

            Debug.Assert(actual_value == expected_value);
        }
コード例 #2
0
        static void VariableTest1(BooleanContext context, PrefixBooleanParser parser)
        {
            var e1 = parser.Parse("X");

            context.SetVariable("X", true);

            var expected_value = true;
            var actual_value   = EvaluateAndPrint(e1, context);

            Debug.Assert(actual_value == expected_value);
        }