private static void AssertWhere <T>(SharePointDataSource <T> src, Expression <Func <T, bool> > predicate, int expectedCount, string message) { IEnumerable <T> res = src.Where <T>(predicate).Select(e => e).AsEnumerable(); Assert.IsTrue(res.Count() == expectedCount && res.All(predicate.Compile()), message); }
private static void AssertWsEqualsSp <T>(SharePointDataSource <T> ws, SharePointDataSource <T> sp, Expression <Func <T, bool> > predicate, string message) { Assert.IsTrue(ws.Where(predicate).AsEnumerable().SequenceEqual(sp.Where(predicate).AsEnumerable()), message); }