Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unit Tests Of Methods Using EF.Functions Broken By EFCore 5 #43

Closed
matttamatic opened this issue Dec 1, 2020 · 5 comments
Closed

Unit Tests Of Methods Using EF.Functions Broken By EFCore 5 #43

matttamatic opened this issue Dec 1, 2020 · 5 comments

Comments

@matttamatic
Copy link

In dotnet/efcore#20294 the client side implementations of EF.Functions methods (eg EF.Functions.Like) were removed which broke any unit tests using them with mockqueryable data.

@matttamatic
Copy link
Author

I'm looking into trying to fix this by borrowing the client side implementations they deleted, but it might be beyond me

@matttamatic
Copy link
Author

Not worth the effort, better off using inmemoryprovider for any tests that require EF extensions.

@matttamatic
Copy link
Author

I think this is a mess, but if anybody wants it, this branch demonstrates a working unit test using EF.Like
https://github.com/matttamatic/MockQueryable/tree/InMemEFLike
All the extra code is taken from various classes in EFCore 5

@hasmikharutyunyan
Copy link

@matttamatic I have the same problem, why have You closed the issue?

@matttamatic
Copy link
Author

matttamatic commented Feb 23, 2021

Because it was vastly easier to rewrite my broken tests using an InMemoryDatabase and every time upstream EF Core made any changes to the InMemory versions of EF.Functions, it would have to be manually pulled again.
(Basically, just that it was an unmaintainable mess)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants