示例#1
0
        public void RewritesVersionPropertyNameToNormalizedVersionPropertyName(Expression originalExpression, Expression expectedExpression)
        {
            // Arrange
            var interceptor = new NormalizeVersionInterceptor();

            // Act
            var rewrittenExpression = interceptor.Visit(originalExpression);

            // Assert
            Assert.Equal(rewrittenExpression.ToString(), expectedExpression.ToString());
        }
        public void ItReturnsNonMatchingExpressions(Expression expr)
        {
            // Arrange
            var interceptor = new NormalizeVersionInterceptor();

            // Act
            var result = interceptor.VisitAndConvert(expr, "Test");

            // Assert
            Assert.Same(expr, result);
        }
示例#3
0
        public void ItReturnsNonMatchingExpressions(Expression expr)
        {
            // Arrange
            var interceptor = new NormalizeVersionInterceptor();

            // Act
            var result = interceptor.VisitAndConvert(expr, "Test");

            // Assert
            Assert.Same(expr, result);
        }
        public void ItRewritesEqualityCheckOfConstantStringAgainstVersionColumn()
        {
            // Arrange
            var interceptor = new NormalizeVersionInterceptor();
            Expression<Func<V2FeedPackage, bool>> expr = (p => "01.00.02" == p.Version);

            // Act
            var result = interceptor.VisitAndConvert(expr, "Test");

            // Assert
            Assert.Equal(
                ((Expression<Func<V2FeedPackage, bool>>)(p => "1.0.2" == p.NormalizedVersion)).ToString(), 
                result.ToString());
        }
示例#5
0
        public void ItRewritesEqualityCheckOfConstantStringAgainstVersionColumn()
        {
            // Arrange
            var interceptor = new NormalizeVersionInterceptor();
            Expression <Func <V2FeedPackage, bool> > expr = (p => "01.00.02" == p.Version);

            // Act
            var result = interceptor.VisitAndConvert(expr, "Test");

            // Assert
            Assert.Equal(
                ((Expression <Func <V2FeedPackage, bool> >)(p => "1.0.2" == p.NormalizedVersion)).ToString(),
                result.ToString());
        }