Exemplo n.º 1
0
        public void TestCaseEvaluationExceptions()
        {
            var @operator = new LogicalOrOperator(TypeConverter);

            ExpectArgumentNullException("context", () => @operator.Evaluate(null, 1, 2));
            ExpectArgumentNullException("context", () => @operator.EvaluateLhs(null, 1, out object dummy));
        }
Exemplo n.º 2
0
        public void TestCaseLhsEvaluation()
        {
            var @operator = new LogicalOrOperator(TypeConverter);

            Assert.IsFalse(@operator.EvaluateLhs(EmptyEvaluationContext, false, out object result));
            Assert.IsTrue(@operator.EvaluateLhs(EmptyEvaluationContext, true, out result) && result.Equals(true));
        }
Exemplo n.º 3
0
        public void TestCaseConstruction3()
        {
            var @operator = new LogicalOrOperator("operator", TypeConverter);

            Assert.AreEqual("operator", @operator.Symbol);
            Assert.AreEqual(12, @operator.Precedence);
            Assert.AreEqual(Associativity.LeftToRight, @operator.Associativity);
        }
Exemplo n.º 4
0
        public void TestCaseEvaluation()
        {
            var @operator = new LogicalOrOperator(TypeConverter);

            AssertEvaluation <bool>(@operator, true, true, true);
            AssertEvaluation <bool>(@operator, true, false, true);
            AssertEvaluation <bool>(@operator, false, true, true);
            AssertEvaluation <bool>(@operator, false, false, false);
        }
 public virtual void Visit(LogicalOrOperator binaryOperator)
 {
     Visit(binaryOperator.Left);
     Visit(binaryOperator.Right);
 }
Exemplo n.º 6
0
        public void TestCaseConstruction2()
        {
            var @operator = new LogicalOrOperator(TypeConverter);

            Assert.AreEqual("||", @operator.Symbol);
        }
Exemplo n.º 7
0
 public override void Visit(LogicalOrOperator binaryOperator)
 {
     WriteBinaryExpression(binaryOperator, "||");
 }
 public override void Visit(LogicalOrOperator binaryOperator)
 {
     Visit(binaryOperator.Left);
     Write(" || ");
     Visit(binaryOperator.Right);
 }