-
-
Notifications
You must be signed in to change notification settings - Fork 813
Issue mocking Entity Framework since 4.7.58 #441
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
Comments
Hi @EricStG, it's a bit difficult to help without seeing any of your code that triggers the exception. Could you please post a minimally complete repro code or unit test that causes the error? |
Hi @stakx, you can find a minimal repro at https://github.com/EricStG/TestEFMoq |
@EricStG: Thanks for the repro code.
Your issue is similar, but not identical to the one you mentioned because your repro code makes use of an extension method |
@EricStG: OK, here are two possible fixes for your failing unit test:
1. Completely set up
|
@stakx That should solve the issue. Thanks for looking into this. |
I spent about a half a day figuring out this. Option two fixed this for me. Thank you. I changed |
thanks second fix work for me |
Looks like I'm having the same issue as #383, except that the fix didn't work for me.
Specifically, I'm using the Entity Framework testing library for Moq (https://github.com/scott-xu/EntityFramework.Testing/blob/master/src/EntityFramework.Testing.Moq)
When trying to Moq a DbSet with Moq >= 4.7.58, I'm getting exceptions. Tested with Moq 4.7.58, 4.7.63 and 4.7.99. Works in Moq 4.7.49.
The text was updated successfully, but these errors were encountered: