So here's the thing: I've got an app that I'm testing that uses LINQ to Entities (EF4/.NET4). The app binds to an implementation of the Contains method that ignores nulls and, due to the way the database is configured, ignores case. That works great.
However, when I call into the same methods from my unit tests, I'm passing in a fake context which exposes collections with an in-memory implementation of IQueryable. In this case, it's the LINQ to Objects version of Contains that gets brought in and that one cares about null and case.
Now, I could write my application code to check for null and case, but I don't want to affect the SQL that's being generated just so it will work when it's being called from a unit test and SQL is not involved.
What I really want is to provide the correct IQueryable or whatever so that, during a test, I can swap in my own custom Contains implementation that ignores null and case. How do I do that? Thanks!