public void VisitChildren_ReturnsSameExpression() { var visitorMock = MockRepository.GenerateStrictMock <RelinqExpressionVisitor> (); visitorMock .Expect(mock => mock.Visit(_evaluatedExpression)) .Return(_evaluatedExpression); visitorMock.Replay(); var result = ExtensionExpressionTestHelper.CallVisitChildren(_exceptionExpression, visitorMock); visitorMock.VerifyAllExpectations(); Assert.That(result, Is.SameAs(_exceptionExpression)); }
public void VisitChildren_ReturnsNewExpression() { var newExpression = Expression.Equal(Expression.Constant("string1"), Expression.Constant("string")); var visitorMock = MockRepository.GenerateStrictMock <RelinqExpressionVisitor> (); visitorMock .Expect(mock => mock.Visit(_evaluatedExpression)) .Return(newExpression); visitorMock.Replay(); var result = ExtensionExpressionTestHelper.CallVisitChildren(_exceptionExpression, visitorMock); visitorMock.VerifyAllExpectations(); Assert.That(result, Is.Not.SameAs(_exceptionExpression)); Assert.That(((PartialEvaluationExceptionExpression)result).Exception, Is.SameAs(_exception)); Assert.That(((PartialEvaluationExceptionExpression)result).EvaluatedExpression, Is.SameAs(newExpression)); }
public void VisitChildren_ReturnsNewExpression() { var newExpression = Expression.Equal(Expression.Constant("string1"), Expression.Constant("string")); var visitorMock = MockRepository.GenerateStrictMock <ExpressionTreeVisitor> (); visitorMock .Expect(mock => mock.VisitExpression(_comparisonExpression)) .Return(newExpression); visitorMock.Replay(); var result = ExtensionExpressionTestHelper.CallVisitChildren(_expression, visitorMock); visitorMock.VerifyAllExpectations(); Assert.That(result, Is.Not.SameAs(_expression)); Assert.That(((VBStringComparisonExpression)result).Comparison, Is.SameAs(newExpression)); Assert.That(((VBStringComparisonExpression)result).TextCompare, Is.True); }