public void SetUp ()
    {
      _exception = new InvalidOperationException ("What");
      _evaluatedExpression = ExpressionHelper.CreateExpression (typeof (double));

      _exceptionExpression = new PartialEvaluationExceptionExpression (_exception, _evaluatedExpression);
    }
    public void PartialEvaluationExceptionExpression_NotEvaluable_AndChildrenNeither ()
    {
      var inner = Expression.Constant (0);
      var expression = new PartialEvaluationExceptionExpression (new Exception(), inner);

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

      Assert.That (evaluationInfo.IsEvaluatableExpression (expression), Is.False);
      Assert.That (evaluationInfo.IsEvaluatableExpression (inner), Is.False);
    }
    public void Visit_PartialEvaluationExceptionExpression_NotEvaluatable ()
    {
      var expression = new PartialEvaluationExceptionExpression (new Exception(), Expression.Constant (1));
      var evaluationInfo = EvaluatableTreeFindingExpressionVisitor.Analyze (expression, new FakeEvaluatableExpressionFilter());

      Assert.That (evaluationInfo.IsEvaluatableExpression (expression), Is.False);
    }
 public virtual Expression VisitPartialEvaluationExceptionExpression (PartialEvaluationExceptionExpression partialEvaluationExceptionExpression)
 {
   ArgumentUtility.CheckNotNull ("partialEvaluationExceptionExpression", partialEvaluationExceptionExpression);
   
   return VisitExpression (partialEvaluationExceptionExpression.EvaluatedExpression);
 }
 public Expression VisitPartialEvaluationExceptionExpression(PartialEvaluationExceptionExpression partialEvaluationExceptionExpression)
 {
     // PartialEvaluationExceptionExpression is not evaluable, and its children aren't either (so we don't visit them).
       _isCurrentSubtreeEvaluatable = false;
       return partialEvaluationExceptionExpression;
 }
    public void Evaluate_PartialEvaluationExceptionExpression_NotEvaluatable ()
    {
      var expression = new PartialEvaluationExceptionExpression (new Exception(), Expression.Constant (1));
      var result = PartialEvaluatingExpressionVisitor.EvaluateIndependentSubtrees (expression, new TestEvaluatableExpressionFilter());

      Assert.That (result, Is.SameAs (expression));
    }