Just an update on the mock entity framework provider - the idea behind it is so that you can develop unit tests against a disconnected dataset, which you can setup in memory as part of the tests, so that the data is in a known state - rather than hitting a live database. To that end I've been experimenting a bit with the
sample entity framework provider.It seems that ObjectQuery<T> cannot be created without specifying a context and a query string. Shame, otherwise I could simply mock the call to the NorthwindModel.Customers { get; } call, and return my own ObjectQuery<Customers> in place of the one the real provider would have returned.It seems that it's created in the entity framework code itself, where ther provider retrieves a datareader and converts it into an ObjectQuery of the class requested.This means that my "dataset framework provider" will have to receive the eSql query command and return a data reader from the dataset that matches the eSql query. This data reader will be picked up by the framework code, which will convert it to an ObjectQuery<T> instance.I found this quite useful "
template data reader" on the msdn pages, where there is example code on how to create a data reader. I plan to look into that a bit more.I will also need to work out how the "dataset framework provider" will actually be given the dataset.Once I have a working sample project, I'll probably chuck it up on codeplex (if David Sceppa's happy for me to, as it will use a large part of the sample entity framework code - I'll have to check).[tags]entity framework, mock, provider[/tags]