What to put as the Provider for a mocked IQueryable

Posted by Vaccano on Stack Overflow See other posts from Stack Overflow or by Vaccano
Published on 2010-02-11T17:13:08Z Indexed on 2010/03/21 3:51 UTC
Read the original article Hit count: 573

Filed under:
|
|
|

I am working with Moles and mocking a System.Data.Linq.Table.

I got it constructing fine, but when I use it, it wants IQueryable.Provider to be mocked (moled) as well.

I just want it to use normal Linq To Objects. Any idea what that would be?

Here is the syntax I can use:

MTable<User> userTable = new System.Data.Linq.Moles.MTable<User>();
userTable.Bind(new List<User> { UserObjectHelper.TestUser() });

// this is the line that needs help
MolesDelegates.Func<IQueryProvider> provider = //Insert provider here!
                                                             ^
userTable.ProviderSystemLinqIQueryableget = provider         |
                                                             |
                                                             | 
what can I put here? ----------------------------------------+

© Stack Overflow or respective owner

Related posts about c#

Related posts about LINQ