I have some methods that return PredicateExpressions built according to a few parameters.
I want to make unit tests for them and for that purpose I would like to make sure the PredicateExpression returned by the method contains exactly what I want.
I want to make sure the PredicateExpression contains 3 PredicateElements.
1- A FieldLikePredicate with specific values.
2- A Or operator
3- A FieldLikePredicate with specific values.
I tried the following but it dosent work.
IPredicateExpressionElement elem = predicateExpression[0];
if (elem.Type == PredicateExpressionElementType.Predicate)
{
FieldLikePredicate flp = elem as FieldLikePredicate;
}
flp is always null.... I guess I'm not doing this right.
Thank you.
Dave.