Closed dlemstra closed 4 years ago
Now wondering if the code should be split up even more. If you would remove the IAsyncQueryProvider
interface and create a separate library called MockQueryable.EntityFrameworkCore
the Core library would be just for mocking IAsyncEnumerable<T>
IOrderedQueryable<T>. That would remove the reference to
EntityFrameworkCoreand make it possible to use the
Core` library in a different situation. I don't mind helping with a PR but feel free to make these changes yourself.
@dlemstra Songs like a good idea. I'll try to find time for it this weekend
@romantitov I already have a proof of concept if you are interested: https://github.com/dlemstra/MockQueryable/tree/test-query-provider.
edit: Seems to not pass the tests will need to investigate :) (Found and fixed the issue)
@dlemstra Sorry for the late answer, was busy. Thanks for the POC I've made the split between Core and EfCore based on it - you can see it in latest changes. I've also included changes from current PR, I'll close it because the PR is not relevant anymore. I'm gonna make the new version (3.1.3) of nuget packages available during the day
PR Details
This PR adds support for the following statement:
Description
I would like to use this library to help with the mocking of
DocumentDb
queries. Mocking these results requires me to implement a classIDocumentQuery<T>
and I would want to inherit fromTestAsyncEnumerable<T>
to reuse some of the code that was already written.But calling
Where
onTestAsyncEnumerable<T>
does not work because theExpression
property is null. And this PR sets theExpression
to a value that just returns the enumerable.Checklist