public void TestCaseEvaluationExceptions() { var @operator = new LogicalAndOperator(TypeConverter); ExpectArgumentNullException("context", () => @operator.Evaluate(null, 1, 2)); ExpectArgumentNullException("context", () => @operator.EvaluateLhs(null, 1, out object dummy)); }
public void TestCaseLhsEvaluation() { var @operator = new LogicalAndOperator(TypeConverter); Assert.IsFalse(@operator.EvaluateLhs(EmptyEvaluationContext, true, out object result)); Assert.IsTrue(@operator.EvaluateLhs(EmptyEvaluationContext, false, out result) && result.Equals(false)); }
public void TestCaseConstruction3() { var @operator = new LogicalAndOperator("operator", TypeConverter); Assert.AreEqual("operator", @operator.Symbol); Assert.AreEqual(11, @operator.Precedence); Assert.AreEqual(Associativity.LeftToRight, @operator.Associativity); }
public void TestCaseEvaluation() { var @operator = new LogicalAndOperator(TypeConverter); AssertEvaluation <bool>(@operator, true, true, true); AssertEvaluation <bool>(@operator, true, false, false); AssertEvaluation <bool>(@operator, false, true, false); AssertEvaluation <bool>(@operator, false, false, false); }
public virtual void Visit(LogicalAndOperator binaryOperator) { Visit(binaryOperator.Left); Visit(binaryOperator.Right); }
public void TestCaseConstruction2() { var @operator = new LogicalAndOperator(TypeConverter); Assert.AreEqual("&&", @operator.Symbol); }
public override void Visit(LogicalAndOperator binaryOperator) { WriteBinaryExpression(binaryOperator, "&&"); }
public override void Visit(LogicalAndOperator binaryOperator) { Visit(binaryOperator.Left); Write(" && "); Visit(binaryOperator.Right); }