public void test_THAT_neq_expression_IS_valid() { var analyzer = new NeqAnalyzer(null, null); Expression <Func <SPListItem, bool> > expr = x => (string)x["Title"] != "testValue"; Assert.That(analyzer.IsValid(expr), Is.True); }
public void test_THAT_neq_expression_IS_determined_properly() { // arrange Expression <Func <SPListItem, bool> > expr = x => (string)x["Title"] != "testValue"; 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 NeqAnalyzer(null, operandBuilder); // act var operation = analyzer.GetOperation(expr); //assert Assert.That(operation, Is.InstanceOf <NeqOperation>()); }