Skip to content

How to test with a mocking framework using Entity Framework Core #259

Closed Answered by chullybun
Kazunari001 asked this question in Q&A
Discussion options

You must be logged in to vote

Hi. Most capabilities enabled by CoreEx, that Beef leverages, are primarily interface driven, by design, and therefore mockable. Also, the IXxxData is a common mocked layer in unit tests where required.

There is no example of the EF and Database mocking as per the link you shared (and there are acknowledged limitations with its usage). I have a philosophical issue with the mocking of key dependencies such as its tightly coupled database, as such the preferred approach has been to unit test intra-domain and mock inter-domain (see definition) dependencies where possible.

By mocking the database dependency so much of the solution is not validated. For example, existence of table(s) and/or co…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Kazunari001
Comment options

Answer selected by Kazunari001
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants