Ejemplo n.º 1
0
        public void test_THAT_membership_expression_with_spwebusers_IS_valid()
        {
            var analyzer = new MembershipAnalyzer(null, null);
            Expression <Func <SPListItem, bool> > expr = x => Camlex.Membership(x["field"], new Camlex.SPWebUsers());

            Assert.That(analyzer.IsValid(expr), Is.True);
        }
Ejemplo n.º 2
0
        public void test_THAT_membership_expression_IS_determined_properly()
        {
            // arrange
            Expression <Func <SPListItem, bool> > expr = x => Camlex.Membership(x["field"], new Camlex.CurrentUserGroups());

            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 MembershipAnalyzer(null, operandBuilder);

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

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