コード例 #1
0
        public void test_THAT_geq_expression_IS_valid()
        {
            var analyzer = new GeqAnalyzer(null, null);
            Expression <Func <SPListItem, bool> > expr = x => (int)x["Count"] >= 1;

            Assert.That(analyzer.IsValid(expr), Is.True);
        }
コード例 #2
0
        public void test_THAT_geq_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 GeqAnalyzer(null, operandBuilder);

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

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