Exemple #1
0
        public void test_THAT_leq_expression_IS_valid()
        {
            var analyzer = new LeqAnalyzer(null, null);
            Expression <Func <SPListItem, bool> > expr = x => (int)x["Count"] <= 1;

            Assert.That(analyzer.IsValid(expr), Is.True);
        }
Exemple #2
0
        public void test_THAT_leq_expression_IS_determined_properly()
        {
            // arrange
            Expression <Func <SPListItem, bool> > expr = x => (int)x["Count"] <= 1;

            var operandBuilder = MockRepository.GenerateStub <IOperandBuilder>();

            operandBuilder.Stub(b => b.CreateFieldRefOperand(expr.Body, null)).Return(null);
            operandBuilder.Stub(b => b.CreateValueOperandForNativeSyntax(expr.Body)).Return(null);

            var analyzer = new LeqAnalyzer(null, operandBuilder);

            // act
            var operation = analyzer.GetOperation(expr);

            //assert
            Assert.That(operation, Is.InstanceOf <LeqOperation>());
        }