So here's the thing: I have an application that I'm testing using LINQ to Entities (EF4 / .NET4). The application is associated with the implementation of the Contains method, which ignores NULL values and, due to the database configuration, ignores case. This works great.
However, when I call the same methods from my unit tests, I go into a fake context that provides collections with IQueryable internal memory. In this case, this is the version of LINQ to Objects of Contains that is being introduced, and that it is of interest to zero and the case.
Now I can write my application code to check the zero and case, but I do not want to influence the SQL, which is generated in such a way that it will work when it is called from unit test, and SQL is not involved.
I really want to provide the correct IQueryable or whatever so that during the test I can change my own implementation of Contains, which ignores null and case. How should I do it? Thank!
source
share