Esempio n. 1
0
        public void test_THAT_string_based_null_expression_IS_valid_isnotnull_expression()
        {
            var operandBuilder = MockRepository.GenerateStub <IOperandBuilder>();

            operandBuilder.Stub(b => b.CreateValueOperandForNativeSyntax(null)).Return(new NullValueOperand()).IgnoreArguments();

            var analyzer = new IsNotNullAnalyzer(null, operandBuilder);
            Expression <Func <SPListItem, bool> > expr = x => x["Count"] != (DataTypes.Integer)null;

            Assert.That(analyzer.IsValid(expr), Is.True);
        }
Esempio n. 2
0
 private bool isNotNullExpression(LambdaExpression expr, out IsNotNullAnalyzer analyzer)
 {
     // the simplest way to check if this IsNotNull expression - is to reuse IsNotNullAnalyzer
     analyzer = new IsNotNullAnalyzer(this.operationResultBuilder, this.operandBuilder);
     return(analyzer.IsValid(expr));
 }