public void VisitNonReducibleExtensionExpression_NotEvaluatable_ButChildrenMayBe ()
    {
      var innerExpression = Expression.MakeBinary (ExpressionType.Equal, Expression.Constant (0), Expression.Constant (0));
      var extensionExpression = new NonReducibleExtensionExpression (innerExpression);

      var evaluationInfo = EvaluatableTreeFindingExpressionVisitor.Analyze (extensionExpression, new FakeEvaluatableExpressionFilter());

      Assert.That (evaluationInfo.IsEvaluatableExpression (extensionExpression), Is.False);
      Assert.That (evaluationInfo.IsEvaluatableExpression (innerExpression), Is.True);
    }
    public void VisitNestedNonReducibleExtensionExpression_NotEvaluatable ()
    {
      var innerExpression = new NonReducibleExtensionExpression (Expression.Constant (1));
      var expression = new ReducibleExtensionExpression (Expression.Add (innerExpression, Expression.Constant (1)));

      var evaluationInfo = EvaluatableTreeFindingExpressionVisitor.Analyze (expression, new FakeEvaluatableExpressionFilter());

      Assert.That (evaluationInfo.IsEvaluatableExpression (expression), Is.False);
      Assert.That (evaluationInfo.IsEvaluatableExpression (innerExpression), Is.False);
    }
    public void VisitNonReducibleExtensionExpression ()
    {
      var innerExpression = Expression.MakeBinary (ExpressionType.Equal, Expression.Constant (0), Expression.Constant (0));
      var extensionExpression = new NonReducibleExtensionExpression (innerExpression);
      
      var result = PartialEvaluatingExpressionVisitor.EvaluateIndependentSubtrees (extensionExpression, new TestEvaluatableExpressionFilter());

      var expected = new NonReducibleExtensionExpression (Expression.Constant (true));
      ExpressionTreeComparer.CheckAreEqualTrees (expected, result);
    }