I have a repository method as follows:
public ICollection<TEntity> Find(Expression<Func<TEntity, bool>> where)
{
return Set.Where(where).ToList();
}
Set is an EntityFramework DbSet<TEntity>
What is the best approach to unit test this method? I can mock the DbSet<TEntity> to return some dummy data easily, but I'm not entirely sure of what constitutes a valid or worthwhile test for this method.
For example, I can test the return type is correct and that an empty collection is returned for a predicate that is clearly never going to be satisfied, but what other tests should I be running?
Should I just write a test that passes an expression that is always true to test true conditions and another test that passes an expression that is always false to test false conditions?